SetMenu compatibility issue

Rob - mypublicaccount at hotmail.com
Fri Jul 12 17:09:22 CDT 2002


Currently, SetMenu only calls SetWindowPos if the window is visible.  MSDN 
doesn't mention visibility checks in SetMenu, it just says "the window is 
redrawn".

Through testing on Win98SE I found that SetMenu does cause 
WM_WINDOWPOSCHANGING,... messages to be sent, even if the window is not 
visible.  So this patch removes the visibility check.

This bug caused the menu bar for MSN Messenger to not be displayed until the 
window was resized by the user.

ChangeLog:
     Made SetMenu call SetWindowPos, even if not WS_VISIBLE

Rob McClinton

Index: controls/menu.c
===================================================================
RCS file: /home/wine/wine/controls/menu.c,v
retrieving revision 1.144
diff -u -s -r1.144 menu.c
--- controls/menu.c	4 Jun 2002 23:08:16 -0000	1.144
+++ controls/menu.c	12 Jul 2002 21:44:57 -0000
@@ -3978,9 +3978,8 @@
     }
     SetWindowLongA( hWnd, GWL_ID, hMenu );

-    if (IsWindowVisible(hWnd))
-        SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
-                      SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
+    SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
+                  SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
     return TRUE;
}




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the wine-patches mailing list