mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[User32]
- Sync up with wine 1.2 rc6 menu so it will pass the tests from rev 47939. svn path=/trunk/; revision=49834
This commit is contained in:
parent
af040adf50
commit
52a1227b43
1 changed files with 19 additions and 12 deletions
|
@ -3487,14 +3487,23 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT
|
|||
|
||||
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))
|
||||
{
|
||||
SendMessageW( hWnd, WM_INITMENU, (WPARAM)hMenu, 0 );
|
||||
|
@ -3512,16 +3521,6 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT
|
|||
}
|
||||
}
|
||||
|
||||
/* 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,6 +3651,7 @@ BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y,
|
|||
HWND Wnd, LPTPMPARAMS Tpm)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
ROSMENUINFO MenuInfo;
|
||||
|
||||
if (!IsMenu(Menu))
|
||||
{
|
||||
|
@ -3659,6 +3659,13 @@ BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
MenuGetRosMenuInfo(&MenuInfo, Menu);
|
||||
if (IsWindow(MenuInfo.Wnd))
|
||||
{
|
||||
SetLastError( ERROR_POPUP_ALREADY_ACTIVE );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MenuInitTracking(Wnd, Menu, TRUE, Flags);
|
||||
|
||||
/* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
|
||||
|
|
Loading…
Reference in a new issue