[1/2] user32: Further implementation of MNS_NOTIFYBYPOS

Dmitry Timoshkov dmitry at codeweavers.com
Fri May 23 04:35:33 CDT 2008


Hello,

Igor asked me to help with a test which may confirm that his patch is correct.
Next patch adds such a test, and this patch passes it.

This patch fixes the bug 12540.

Changelog:
    Igor Tarasov <tarasov.igor at gmail.com>
    user32: Further implementation of MNS_NOTIFYBYPOS.
---
 dlls/user32/menu.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 49de5e1..dd859b1 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -2472,7 +2472,10 @@ static INT MENU_ExecFocusedItem( MTRACKER* pmt, HMENU hMenu, UINT wFlags )
 				  MAKELPARAM((INT16)pmt->pt.x, (INT16)pmt->pt.y) );
 		else
 		{
-                    if (menu->dwStyle & MNS_NOTIFYBYPOS)
+                    POPUPMENU *topmenu = MENU_GetMenu( pmt->hTopMenu );
+                    DWORD dwStyle = menu->dwStyle | (topmenu ? topmenu->dwStyle : 0);
+
+                    if (dwStyle & MNS_NOTIFYBYPOS)
                         PostMessageW( pmt->hOwnerWnd, WM_MENUCOMMAND, menu->FocusedItem,
                                       (LPARAM)hMenu);
                     else
-- 
1.5.5.1






More information about the wine-patches mailing list