implemented EndMenu()

svn path=/trunk/; revision=7276
This commit is contained in:
Thomas Bluemel 2003-12-28 00:19:24 +00:00
parent 023ebb37c2
commit 12c7158866
2 changed files with 100 additions and 18 deletions

View file

@ -16,7 +16,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.38 2003/12/24 21:10:16 navaraf Exp $ /* $Id: menu.c,v 1.39 2003/12/28 00:19:24 weiden Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/menu.c * FILE: lib/user32/windows/menu.c
@ -65,6 +65,8 @@
#define POPUPMENU_CLASS_ATOMA MAKEINTATOMA(32768) /* PopupMenu */ #define POPUPMENU_CLASS_ATOMA MAKEINTATOMA(32768) /* PopupMenu */
#define POPUPMENU_CLASS_ATOMW MAKEINTATOMW(32768) /* PopupMenu */ #define POPUPMENU_CLASS_ATOMW MAKEINTATOMW(32768) /* PopupMenu */
static LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
/********************************************************************* /*********************************************************************
* PopupMenu class descriptor * PopupMenu class descriptor
*/ */
@ -72,11 +74,11 @@ const struct builtin_class_descr POPUPMENU_builtin_class =
{ {
POPUPMENU_CLASS_ATOMW, /* name */ POPUPMENU_CLASS_ATOMW, /* name */
CS_GLOBALCLASS | CS_SAVEBITS | CS_DBLCLKS, /* style */ CS_GLOBALCLASS | CS_SAVEBITS | CS_DBLCLKS, /* style */
(WNDPROC) NULL, /* FIXME - procW */ (WNDPROC) PopupMenuWndProcW, /* FIXME - procW */
(WNDPROC) NULL, /* FIXME - procA */ (WNDPROC) NULL, /* FIXME - procA */
sizeof(MENUINFO *), /* extra */ sizeof(MENUINFO *), /* extra */
(LPCWSTR) IDC_ARROW, /* cursor */ (LPCWSTR) IDC_ARROW, /* cursor */
(HBRUSH)COLOR_MENU /* brush */ (HBRUSH)(COLOR_MENU + 1) /* brush */
}; };
@ -97,6 +99,16 @@ const struct builtin_class_descr POPUPMENU_builtin_class =
HFONT hMenuFont = NULL; HFONT hMenuFont = NULL;
HFONT hMenuFontBold = NULL; HFONT hMenuFontBold = NULL;
static LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
default:
return DefWindowProcW(hwnd, message, wParam, lParam);
}
return 0;
}
/********************************************************************** /**********************************************************************
* MENUEX_ParseResource * MENUEX_ParseResource
* *
@ -593,14 +605,18 @@ EnableMenuItem(HMENU hMenu,
} }
/* /*
* @unimplemented * @implemented
*/ */
WINBOOL STDCALL WINBOOL STDCALL
EndMenu(VOID) EndMenu(VOID)
{ {
UNIMPLEMENTED; GUITHREADINFO guii;
/* FIXME - return NtUserEndMenu(); */ guii.cbSize = sizeof(GUITHREADINFO);
return FALSE; if(GetGUIThreadInfo(GetCurrentThreadId(), &guii) && guii.hwndMenuOwner)
{
PostMessageW(guii.hwndMenuOwner, WM_CANCELMODE, 0, 0);
}
return TRUE;
} }
@ -1293,7 +1309,7 @@ SetMenuItemInfoW(
/* /*
* @unimplemented * @implemented
*/ */
WINBOOL WINBOOL
STDCALL STDCALL
@ -1306,13 +1322,21 @@ TrackPopupMenu(
HWND hWnd, HWND hWnd,
CONST RECT *prcRect) CONST RECT *prcRect)
{ {
UNIMPLEMENTED; TPMPARAMS tpm;
return FALSE;
if(prcRect)
{
tpm.cbSize = sizeof(TPMPARAMS);
tpm.rcExclude = *prcRect;
}
return (WINBOOL)NtUserTrackPopupMenuEx(hMenu, uFlags, x, y, hWnd,
(prcRect ? &tpm : NULL));
} }
/* /*
* @unimplemented * @implemented
*/ */
WINBOOL WINBOOL
STDCALL STDCALL
@ -1324,8 +1348,7 @@ TrackPopupMenuEx(
HWND hwnd, HWND hwnd,
LPTPMPARAMS lptpm) LPTPMPARAMS lptpm)
{ {
UNIMPLEMENTED; return (WINBOOL)NtUserTrackPopupMenuEx(hmenu, fuFlags, x, y, hwnd, lptpm);
return FALSE;
} }

View file

@ -16,7 +16,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.36 2003/12/22 15:30:21 navaraf Exp $ /* $Id: menu.c,v 1.37 2003/12/28 00:19:24 weiden Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -38,6 +38,7 @@
#include <include/guicheck.h> #include <include/guicheck.h>
#include <include/window.h> #include <include/window.h>
#include <include/color.h> #include <include/color.h>
#include <internal/safe.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
@ -1035,6 +1036,16 @@ IntGetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT fByPos, UINT gmdiFlags,
return res; return res;
} }
BOOL FASTCALL
IntTrackPopupMenu(PMENU_OBJECT MenuObject, PWINDOW_OBJECT WindowObject,
UINT Flags, POINT *Pos, UINT MenuPos, RECT *ExcludeRect)
{
return FALSE;
}
/*! /*!
* Internal function. Called when the process is destroyed to free the remaining menu handles. * Internal function. Called when the process is destroyed to free the remaining menu handles.
*/ */
@ -1607,7 +1618,7 @@ NtUserThunkedMenuItemInfo(
/* /*
* @unimplemented * @implemented
*/ */
BOOL STDCALL BOOL STDCALL
NtUserTrackPopupMenuEx( NtUserTrackPopupMenuEx(
@ -1618,9 +1629,57 @@ NtUserTrackPopupMenuEx(
HWND hwnd, HWND hwnd,
LPTPMPARAMS lptpm) LPTPMPARAMS lptpm)
{ {
UNIMPLEMENTED PMENU_OBJECT MenuObject;
PWINDOW_OBJECT WindowObject;
return 0; TPMPARAMS Safetpm;
NTSTATUS Status;
POINT Pos;
BOOL Ret;
MenuObject = IntGetMenuObject(hmenu);
if(!MenuObject)
{
SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
return FALSE;
}
WindowObject = IntGetWindowObject(hwnd);
if(!WindowObject)
{
IntReleaseMenuObject(MenuObject);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
if(lptpm)
{
Status = MmCopyFromCaller(&Safetpm, lptpm, sizeof(TPMPARAMS));
if(!NT_SUCCESS(Status))
{
IntReleaseWindowObject(WindowObject);
IntReleaseMenuObject(MenuObject);
SetLastNtError(Status);
return FALSE;
}
if(Safetpm.cbSize != sizeof(TPMPARAMS))
{
IntReleaseWindowObject(WindowObject);
IntReleaseMenuObject(MenuObject);
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
}
Pos.x = x;
Pos.y = y;
Ret = IntTrackPopupMenu(MenuObject, WindowObject, fuFlags, &Pos, 0,
(lptpm ? &Safetpm.rcExclude : NULL));
IntReleaseWindowObject(WindowObject);
IntReleaseMenuObject(MenuObject);
return Ret;
} }