Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OpenCV in MFC App Pin
Don Guy6-Feb-14 9:53
Don Guy6-Feb-14 9:53 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 10:29
professionalSoMad6-Feb-14 10:29 
GeneralRe: OpenCV in MFC App Pin
Don Guy6-Feb-14 10:55
Don Guy6-Feb-14 10:55 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 12:10
professionalSoMad6-Feb-14 12:10 
GeneralRe: OpenCV in MFC App Pin
Don Guy6-Feb-14 13:05
Don Guy6-Feb-14 13:05 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 13:12
professionalSoMad6-Feb-14 13:12 
GeneralRe: OpenCV in MFC App Pin
SoMad6-Feb-14 13:36
professionalSoMad6-Feb-14 13:36 
QuestionWinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 6:44
professionalDerell Licht5-Feb-14 6:44 
I have a Windows dialog-based application here. I have a button that calls ChooseColor() to let the user select a new color for the program. However, when I click the button, the color dialog opens, but the mouse and keyboard appear to be completely ignored on it.

I've never seen this happen before, does anyone know what could cause this?? The relevant code is included below.


//****************************************************************
static int select_color(HWND hwnd, COLORREF old_attr)
{
static CHOOSECOLOR cc ;
static COLORREF crCustColors[16] ;

// init-int this array did not affect the mouse problem
// uint idx ;
// for (idx=0; idx<16; idx++) {
// crCustColors[idx] = RGB(idx, idx, idx) ;
// }

ZeroMemory(&cc, sizeof(cc));
cc.lStructSize = sizeof (CHOOSECOLOR) ;
cc.rgbResult = old_attr ;
cc.lpCustColors = crCustColors ;
cc.Flags = CC_RGBINIT | CC_FULLOPEN ;
// cc.hwndOwner = hwnd ; // this hangs parent, as well as me

if (ChooseColor(&cc) == TRUE) {
return (int) cc.rgbResult ;
} else {
return -1 ;
}
}

//******************************************************************
case WM_COMMAND: // for keyboard handling
{ // create local context
DWORD cmd = HIWORD (wParam) ;
DWORD target = LOWORD(wParam) ;

switch (cmd) {
case BN_CLICKED:
switch(target) {
case IDB_ATTR_SET:
result = select_color(hwnd, test_init.set_bit) ;
if (result >= 0) {
// do something with the value
}
break;
} //lint !e744 switch target
return true;
} //lint !e744 switch cmd

//************
Later note: I created a stripped-down version of this application, which demonstrates this issue. I don't see any way to attach a file here, but the package can be downloaded from my website:

home.comcast.net/~derelict/files/ChooseColor.hang.zip

This is built using MinGW toolchain. It has been tested on multiple Win7/64bit and WinXP/SP3/32bit machines, all showing the same behavior.
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Richard MacCutchan5-Feb-14 7:12
mveRichard MacCutchan5-Feb-14 7:12 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 7:40
professionalDerell Licht5-Feb-14 7:40 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Richard MacCutchan5-Feb-14 7:52
mveRichard MacCutchan5-Feb-14 7:52 
GeneralRe: WinAPI/C++/Dialog - ChooseColor() ignoring mouse Pin
Derell Licht5-Feb-14 8:17
professionalDerell Licht5-Feb-14 8:17 
Questionproblem with RegSetvalue in c++ Pin
mohamad mahdi zeinali5-Feb-14 1:18
mohamad mahdi zeinali5-Feb-14 1:18 
AnswerRe: problem with RegSetvalue in c++ Pin
Richard MacCutchan5-Feb-14 1:39
mveRichard MacCutchan5-Feb-14 1:39 
GeneralRe: problem with RegSetvalue in c++ Pin
mohamad mahdi zeinali5-Feb-14 1:52
mohamad mahdi zeinali5-Feb-14 1:52 
GeneralRe: problem with RegSetvalue in c++ Pin
Richard MacCutchan5-Feb-14 2:03
mveRichard MacCutchan5-Feb-14 2:03 
QuestionWNetGetConnection API behaves wrongly when UAC is enabled Pin
atm.menon4-Feb-14 19:19
atm.menon4-Feb-14 19:19 
GeneralRe: WNetGetConnection API behaves wrongly when UAC is enabled Pin
Malli_S4-Feb-14 22:00
Malli_S4-Feb-14 22:00 
GeneralRe: WNetGetConnection API behaves wrongly when UAC is enabled Pin
atm.menon12-Feb-14 15:38
atm.menon12-Feb-14 15:38 
QuestionLining up the Decimal Points Pin
BobInNJ4-Feb-14 16:50
BobInNJ4-Feb-14 16:50 
AnswerRe: Lining up the Decimal Points Pin
Malli_S4-Feb-14 21:58
Malli_S4-Feb-14 21:58 
GeneralRe: Lining up the Decimal Points Pin
BobInNJ5-Feb-14 3:24
BobInNJ5-Feb-14 3:24 
GeneralRe: Lining up the Decimal Points Pin
Malli_S5-Feb-14 21:12
Malli_S5-Feb-14 21:12 
QuestionRe: Lining up the Decimal Points Pin
David Crow5-Feb-14 6:18
David Crow5-Feb-14 6:18 
AnswerRe: Lining up the Decimal Points Pin
BobInNJ5-Feb-14 11:10
BobInNJ5-Feb-14 11:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.