Implement TrackPopupMenu. This fixes bug #131

svn path=/trunk/; revision=8716
This commit is contained in:
Gé van Geldorp 2004-03-14 16:39:49 +00:00
parent e8f56accc6
commit c72fe4771e

View file

@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: menu.c,v 1.54 2004/03/10 20:36:19 silverblade Exp $ /* $Id: menu.c,v 1.55 2004/03/14 16:39:49 gvg Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/menu.c * FILE: lib/user32/windows/menu.c
@ -4200,41 +4200,50 @@ SetSystemMenu (
BOOL BOOL
STDCALL STDCALL
TrackPopupMenu( TrackPopupMenu(
HMENU hMenu, HMENU Menu,
UINT uFlags, UINT Flags,
int x, int x,
int y, int y,
int nReserved, int Reserved,
HWND hWnd, HWND Wnd,
CONST RECT *prcRect) CONST RECT *Rect)
{ {
TPMPARAMS tpm; BOOL ret = FALSE;
if(prcRect) MenuInitTracking(Wnd, Menu, TRUE, Flags);
{
tpm.cbSize = sizeof(TPMPARAMS); /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */
tpm.rcExclude = *prcRect; if (0 == (Flags & TPM_NONOTIFY))
} {
SendMessageW(Wnd, WM_INITMENUPOPUP, (WPARAM) Menu, 0);
return (BOOL)NtUserTrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, }
(prcRect ? &tpm : NULL));
if (MenuShowPopup(Wnd, Menu, 0, x, y, 0, 0 ))
{
ret = MenuTrackMenu(Menu, Flags | TPM_POPUPMENU, 0, 0, Wnd, Rect);
}
MenuExitTracking(Wnd);
return ret;
} }
/* /*
* @implemented * @unimplemented
*/ */
BOOL BOOL
STDCALL STDCALL
TrackPopupMenuEx( TrackPopupMenuEx(
HMENU hmenu, HMENU Menu,
UINT fuFlags, UINT Flags,
int x, int x,
int y, int y,
HWND hwnd, HWND Wnd,
LPTPMPARAMS lptpm) LPTPMPARAMS Tpm)
{ {
return (BOOL)NtUserTrackPopupMenuEx(hmenu, fuFlags, x, y, hwnd, lptpm); /* Not fully implemented */
return TrackPopupMenu(Menu, Flags, x, y, 0, Wnd,
NULL != Tpm ? &Tpm->rcExclude : NULL);
} }