[ros-diffs] [jimtabor] 49834: [User32] - Sync up with wine 1.2 rc6 menu so it will pass the tests from rev 47939.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun Nov 28 01:37:17 UTC 2010


Author: jimtabor
Date: Sun Nov 28 01:37:16 2010
New Revision: 49834

URL: http://svn.reactos.org/svn/reactos?rev=49834&view=rev
Log:
[User32]
- Sync up with wine 1.2 rc6 menu so it will pass the tests from rev 47939.

Modified:
    trunk/reactos/dll/win32/user32/windows/menu.c

Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/menu.c?rev=49834&r1=49833&r2=49834&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Sun Nov 28 01:37:16 2010
@@ -3487,13 +3487,22 @@
 
     HideCaret(0);
 
+    MenuGetRosMenuInfo(&MenuInfo, hMenu);
+    /* This makes the menus of applications built with Delphi work.
+     * It also enables menus to be displayed in more than one window,
+     * but there are some bugs left that need to be fixed in this case.
+     */
+    if(MenuInfo.Self == hMenu)
+    {
+        MenuInfo.Wnd = hWnd;
+        MenuSetRosMenuInfo(&MenuInfo);
+    }
+
     /* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */
     if (!(wFlags & TPM_NONOTIFY))
        SendMessageW( hWnd, WM_ENTERMENULOOP, bPopup, 0 );
 
     SendMessageW( hWnd, WM_SETCURSOR, (WPARAM)hWnd, HTCAPTION );
-
-    MenuGetRosMenuInfo(&MenuInfo, hMenu);
 
     if (!(wFlags & TPM_NONOTIFY))
     {
@@ -3512,16 +3521,6 @@
        }
     }
 
-    /* This makes the menus of applications built with Delphi work.
-     * It also enables menus to be displayed in more than one window,
-     * but there are some bugs left that need to be fixed in this case.
-     */
-    if(MenuInfo.Self == hMenu)
-    {
-        MenuInfo.Wnd = hWnd;
-        MenuSetRosMenuInfo(&MenuInfo);
-    }
-
     IntNotifyWinEvent( EVENT_SYSTEM_MENUSTART,
                        hWnd,
                        MenuInfo.Flags & MF_SYSMENU ? OBJID_SYSMENU : OBJID_MENU,
@@ -3652,11 +3651,19 @@
                               HWND Wnd, LPTPMPARAMS Tpm)
 {
     BOOL ret = FALSE;
+    ROSMENUINFO MenuInfo;
 
     if (!IsMenu(Menu))    
     {
       SetLastError( ERROR_INVALID_MENU_HANDLE );
       return FALSE;
+    }
+
+    MenuGetRosMenuInfo(&MenuInfo, Menu);
+    if (IsWindow(MenuInfo.Wnd))
+    {
+        SetLastError( ERROR_POPUP_ALREADY_ACTIVE );
+        return FALSE;
     }
 
     MenuInitTracking(Wnd, Menu, TRUE, Flags);




More information about the Ros-diffs mailing list