updown: proper handling for GWL_STYLE

Dimitrie O. Paun dpaun at rogers.com
Sun Mar 27 09:39:22 CST 2005


On Fri, Mar 25, 2005 at 12:09:44PM -0600, Robert Shearman wrote:
> Dimitrie O. Paun wrote:
> 
> >ChangeLog
> >   Proper handling for GWL_STYLE.
> >   Minor cleanups.
> >	case WM_ENABLE:
> >-	    if (dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
> >+	    if (infoPtr->dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
> >	    InvalidateRect (infoPtr->Self, NULL, FALSE);
> >
> 
> You need to update infoPtr->dwStyle here. EnableWindow(FALSE) does not 
> generate a WM_STYLECHANGED message.

True. What about this (untested, I don't have an app that enables/disables
the control):


ChangeLog
    Update the WS_DISABLED flag in WM_ENABLED, since we don't get a
    WM_STYLECHANGED message for disabling the window.
    Don't call cancel mode explicetly, the system is supposed to send
    us a WM_CANCELMODE on a disable event anyway.

Index: dlls/comctl32/updown.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/updown.c,v
retrieving revision 1.66
diff -u -r1.66 updown.c
--- dlls/comctl32/updown.c	25 Mar 2005 10:27:11 -0000	1.66
+++ dlls/comctl32/updown.c	27 Mar 2005 15:31:12 -0000
@@ -775,7 +775,8 @@
 	    break;
 
 	case WM_ENABLE:
-	    if (infoPtr->dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
+	    infoPtr->dwStyle &= ~WS_DISABLED;
+	    infoPtr->dwStyle |= (wParam ? 0 : WS_DISABLED);
 	    InvalidateRect (infoPtr->Self, NULL, FALSE);
 	    break;
 

-- 
Dimi.



More information about the wine-patches mailing list