[PATCH] Wm_CtlColorStatic for static controls

gerard patel gerard.patel at asi.fr
Sat Mar 10 04:28:32 CST 2001


Using the StatView demo (www.statview.com), the initial message
stating that it is a demo version appears with a white background,
while under Windows it has the normal color window (since Win95 that is).

The reason is that the app returns 0 for wm_ctlcolorstatic. This is
probably a small bug, since apps are supposed to return 0 when the
control is in a dialog box. As it is a standard window, it should have
called DefWindowProc. Calling it for the app seems to reproduce the
Window behaviour more precisely.

Note that this behaviour does not happen for other controls when
they are disabled.

ChangeLog:

    * controls/static.c
    Calls DefWindowProc for wm_ctlcolorctatic message when the apps does not.
-------------- next part --------------
Index: controls/static.c
===================================================================
RCS file: /home/wine/wine/controls/static.c,v
retrieving revision 1.27
diff -u -r1.27 static.c
--- controls/static.c	2001/01/15 20:12:55	1.27
+++ controls/static.c	2001/03/10 10:23:02
@@ -445,7 +445,9 @@
     {
         hBrush = SendMessageW( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
                              hdc, wndPtr->hwndSelf );
-        if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
+        if (!hBrush) /* did the app forget to call defwindowproc ? */
+            hBrush = DefWindowProcW(GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
+                                    hdc, wndPtr->hwndSelf);
         FillRect( hdc, &rc, hBrush );    
     }
     if (!IsWindowEnabled(wndPtr->hwndSelf))
-------------- next part --------------



More information about the wine-patches mailing list