Ignore WS_MINIMIZE and WS_MAXIMIZE in SetWindowLong

Robert Shearman rob at codeweavers.com
Mon Aug 23 22:06:00 CDT 2004


Hi,
According to this URL a number of WS_ flags cannot be changed after the 
window is created (using SetWindowLong):
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/Windows/WindowReference/WindowStyles.asp
This patch uses that information and ignores just the WS_MINIMIZE and 
WS_MAXIMIZE styles in SetWindowLong.

Changelog:
Ignore WS_MINIMIZE and WS_MAXIMIZE in SetWindowLong.

-------------- next part --------------
Index: wine/windows/win.c
===================================================================
RCS file: /home/wine/wine/windows/win.c,v
retrieving revision 1.244
diff -u -p -r1.244 win.c
--- wine/windows/win.c	20 Jul 2004 22:25:16 -0000	1.244
+++ wine/windows/win.c	24 Aug 2004 03:00:08 -0000
@@ -2076,7 +2076,10 @@ static LONG WIN_SetWindowLong( HWND hwnd
     case GWL_EXSTYLE:
         style.styleOld =
             offset == GWL_STYLE ? wndPtr->dwStyle : wndPtr->dwExStyle;
-        style.styleNew = newval;
+        if (offset == GWL_STYLE)
+            style.styleNew = (newval & ~(WS_MINIMIZE|WS_MAXIMIZE)) | (style.styleOld & (WS_MINIMIZE|WS_MAXIMIZE));
+        else
+            style.styleNew = newval;
         WIN_ReleasePtr( wndPtr );
         SendMessageW( hwnd, WM_STYLECHANGING, offset, (LPARAM)&style );
         if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0;


More information about the wine-patches mailing list