#7 patch for WM_CTLCOLOR

closed
nobody
None
5
2005-03-25
2005-01-09
Steven Weiss
No

hi john,
i tried to use WM_CTLCOLOR for an edit to make it
transparent but it didn't work. after some debugging
and spying i discovered that the windowproc always
returns 1 (or TRUE) for WM_CTLCOLOR so i found the
error to be in the dispatcher. the code must be like this:

INT_PTR CALLBACK dispatcher::dlg_proc( HWND h, UINT
wm_msg, WPARAM wParam, LPARAM lParam) {
...
// we're on our own ;)
switch (wm_msg) {
case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX:
case WM_CTLCOLORBTN:
case WM_CTLCOLORDLG:
case WM_CTLCOLORSCROLLBAR:
case WM_CTLCOLORSTATIC:
return (BOOL) msg.l_result;

case WM_COMPAREITEM:
case WM_VKEYTOITEM:
case WM_CHARTOITEM:
case WM_INITDIALOG:
case WM_QUERYDRAGICON:
// return directly
break;
...

before you treated the WM_CTLCOLORxxx messages like the
other messages - they return TRUE or FALSE

mfg steven

Discussion

  • Steven Weiss
    Steven Weiss
    2005-03-25

    • status: open --> closed