NtUserCreateCursorIconHandle 2
NtUserCreateDesktop 5
NtUserCreateLocalMemHandle 4
-NtUserCreateMenu 0
+NtUserCreateMenu 1
NtUserCreateWindowEx 14
NtUserCreateWindowStation 6
NtUserDdeGetQualityOfService 3
DWORD Param,
DWORD Routine);
+#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT 0x50
#define TWOPARAM_ROUTINE_SETMENUITEMRECT 0x51
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE 0x52
#define TPR_SGTH_ACTIVE 0x01
HMENU
STDCALL
-NtUserCreateMenu(VOID);
+NtUserCreateMenu(BOOL PopupMenu);
HWND
STDCALL
#define NtUserSetMenuItemRect(menu, mir) \
(BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)mir, TWOPARAM_ROUTINE_SETMENUITEMRECT)
+#define NtUserSetMenuBarHeight(menu, height) \
+ (BOOL)NtUserCallTwoParam((DWORD)menu, (DWORD)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT)
+
#define NtUserSetCaretBlinkTime(uMSeconds) \
(BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: menu.c,v 1.43 2004/01/26 10:09:04 weiden Exp $
+/* $Id: menu.c,v 1.44 2004/01/26 12:46:16 weiden Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/menu.c
VOID
MenuTrackMouseMenuBar(HWND hWnd, ULONG Ht, POINT Pt)
-{
+{DbgPrint("MenuTrackMouseMenuBar at %i, %i\n", Pt.x, Pt.y);
+ int Item = NtUserMenuItemFromPoint(hWnd, GetMenu(hWnd), Pt.x, Pt.y);
+
+ if(Item > -1)
+ {
+
+ }
}
HMENU STDCALL
CreateMenu(VOID)
{
- return NtUserCreateMenu();
+ return NtUserCreateMenu(FALSE);
}
HMENU STDCALL
CreatePopupMenu(VOID)
{
- /* FIXME - add MF_POPUP style? */
- return NtUserCreateMenu();
+ return NtUserCreateMenu(TRUE);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
GetMenuBarInfo(HWND hwnd,
LONG idItem,
PMENUBARINFO pmbi)
{
- UNIMPLEMENTED;
- return FALSE;
+ return (BOOL)NtUserGetMenuBarInfo(hwnd, idObject, idItem, pmbi);
}
/*
- * @unimplemented
+ * @implemented
*/
int
STDCALL
HMENU hMenu,
POINT ptScreen)
{
- UNIMPLEMENTED;
- return 0;
+ return NtUserMenuItemFromPoint(hWnd, hMenu, ptScreen.x, ptScreen.y);
}
#include <menu.h>
#include <winpos.h>
#include <user32/wininternal.h>
+#include <user32.h>
#define NDEBUG
#include <debug.h>
if(!(Style & WS_MINIMIZE))
{
+ HMENU menu;
+
ClientPoint = Point;
ScreenToClient(hWnd, &ClientPoint);
GetClientRect(hWnd, &ClientRect);
return HTCLIENT;
}
- if (UserHasMenu(hWnd, Style))
+ if ((menu = GetMenu(hWnd)) && !(Style & WS_CHILD))
{
- if (Point.y < 0 && Point.x >= 0 && Point.x <= WindowRect.right)
+ if (Point.x > 0 && Point.x < WindowRect.right && ClientPoint.y < 0)
return HTMENU;
}
MENUINFO MenuInfo;
BOOL RtoL;
BOOL IsSystemMenu;
+ BOOL IsMenuBar;
+ int Height;
} MENU_OBJECT, *PMENU_OBJECT;
PMENU_OBJECT FASTCALL
IntDestroyMenuObject(PMENU_OBJECT MenuObject, BOOL bRecurse, BOOL RemoveFromProcess);
PMENU_OBJECT FASTCALL
-IntCreateMenu(PHANDLE Handle);
+IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar);
PMENU_OBJECT FASTCALL
IntCloneMenu(PMENU_OBJECT Source);
NTSTATUS FASTCALL
CleanupMenuImpl(VOID);
-DWORD
-STDCALL
-NtUserBuildMenuItemList(
- HMENU hMenu,
- PVOID Buffer,
- ULONG nBufSize,
- DWORD Reserved);
-
-DWORD
-STDCALL
-NtUserCheckMenuItem(
- HMENU hmenu,
- UINT uIDCheckItem,
- UINT uCheck);
-
-HMENU
-STDCALL
-NtUserCreateMenu(VOID);
-
-BOOL
-STDCALL
-NtUserDeleteMenu(
-HMENU hMenu,
- UINT uPosition,
- UINT uFlags);
-
-BOOL
-STDCALL
-NtUserDestroyMenu(
- HMENU hMenu);
-
-DWORD
-STDCALL
-NtUserDrawMenuBarTemp(
- HWND hWnd,
- HDC hDC,
- PRECT hRect,
- HMENU hMenu,
- HFONT hFont);
-
-UINT
-STDCALL
-NtUserEnableMenuItem(
- HMENU hMenu,
- UINT uIDEnableItem,
- UINT uEnable);
-
-DWORD
-STDCALL
-NtUserInsertMenuItem(
- HMENU hMenu,
- UINT uItem,
- BOOL fByPosition,
- LPCMENUITEMINFOW lpmii);
-
-
-BOOL
-STDCALL
-NtUserEndMenu(VOID);
-
-UINT
-STDCALL
-NtUserGetMenuDefaultItem(
- HMENU hMenu,
- UINT fByPos,
- UINT gmdiFlags);
-
-BOOL
-STDCALL
-NtUserGetMenuBarInfo(
- HWND hwnd,
- LONG idObject,
- LONG idItem,
- PMENUBARINFO pmbi);
-
-UINT
-STDCALL
-NtUserGetMenuIndex(
- HMENU hMenu,
- UINT wID);
-
-BOOL
-STDCALL
-NtUserGetMenuItemRect(
- HWND hWnd,
- HMENU hMenu,
- UINT uItem,
- LPRECT lprcItem);
-
-BOOL
-STDCALL
-NtUserHiliteMenuItem(
- HWND hwnd,
- HMENU hmenu,
- UINT uItemHilite,
- UINT uHilite);
-
-BOOL
-STDCALL
-NtUserMenuInfo(
- HMENU hmenu,
- LPMENUINFO lpmi,
- BOOL fsog);
-
-int
-STDCALL
-NtUserMenuItemFromPoint(
- HWND hWnd,
- HMENU hMenu,
- DWORD X,
- DWORD Y);
-
-BOOL
-STDCALL
-NtUserMenuItemInfo(
- HMENU hMenu,
- UINT uItem,
- BOOL fByPosition,
- LPMENUITEMINFOW lpmii,
- BOOL fsog);
-
-BOOL
-STDCALL
-NtUserRemoveMenu(
- HMENU hMenu,
- UINT uPosition,
- UINT uFlags);
-
-BOOL
-STDCALL
-NtUserSetMenuContextHelpId(
- HMENU hmenu,
- DWORD dwContextHelpId);
-
-BOOL
-STDCALL
-NtUserSetMenuDefaultItem(
- HMENU hMenu,
- UINT uItem,
- UINT fByPos);
-
-BOOL
-STDCALL
-NtUserSetMenuFlagRtoL(
- HMENU hMenu);
-
-DWORD
-STDCALL
-NtUserThunkedMenuInfo(
- HMENU hMenu,
- LPCMENUINFO lpcmi);
-
-DWORD
-STDCALL
-NtUserThunkedMenuItemInfo(
- HMENU hMenu,
- UINT uItem,
- BOOL fByPosition,
- BOOL bInsert,
- LPMENUITEMINFOW lpmii,
- PUNICODE_STRING lpszCaption);
-
-BOOL
-STDCALL
-NtUserTrackPopupMenuEx(
- HMENU hmenu,
- UINT fuFlags,
- int x,
- int y,
- HWND hwnd,
- LPTPMPARAMS lptpm);
-
#endif /* _WIN32K_MENU_H */
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: menu.c,v 1.41 2004/01/26 10:09:04 weiden Exp $
+/* $Id: menu.c,v 1.42 2004/01/26 12:46:16 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
} \
}
+#define InRect(r, x, y) \
+ ( ( ((r).right >= x)) && \
+ ( ((r).left <= x)) && \
+ ( ((r).bottom >= y)) && \
+ ( ((r).top <= y)) )
+
NTSTATUS FASTCALL
InitMenuImpl(VOID)
{
}
PMENU_OBJECT FASTCALL
-IntCreateMenu(PHANDLE Handle)
+IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar)
{
PMENU_OBJECT MenuObject;
PW32PROCESS Win32Process = PsGetWin32Process();
}
MenuObject->Self = *Handle;
+ MenuObject->IsMenuBar = IsMenuBar;
MenuObject->W32Process = Win32Process;
MenuObject->RtoL = FALSE; /* default */
MenuObject->MenuInfo.cbSize = sizeof(MENUINFO); /* not used */
* @unimplemented
*/
HMENU STDCALL
-NtUserCreateMenu(VOID)
+NtUserCreateMenu(BOOL PopupMenu)
{
PWINSTATION_OBJECT WinStaObject;
HANDLE Handle;
return (HMENU)0;
}
- IntCreateMenu(&Handle);
+ IntCreateMenu(&Handle, !PopupMenu);
ObDereferenceObject(WinStaObject);
return (HMENU)Handle;
/*
- * @unimplemented
+ * @implemented
*/
int STDCALL
NtUserMenuItemFromPoint(
DWORD X,
DWORD Y)
{
- UNIMPLEMENTED
-
- return 0;
+ PMENU_OBJECT MenuObject;
+ PWINDOW_OBJECT WindowObject;
+ PMENU_ITEM mi;
+ int i;
+
+ MenuObject = IntGetMenuObject(hMenu);
+ if(!MenuObject)
+ {
+ SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
+ return -1;
+ }
+ if(hWnd)
+ {
+ WindowObject = IntGetWindowObject(hWnd);
+ if(!WindowObject)
+ {
+ SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
+ return -1;
+ }
+ }
+
+ ExAcquireFastMutexUnsafe(&MenuObject->MenuItemsLock);
+ mi = MenuObject->MenuItemList;
+ for(i = 0; mi; i++)
+ {
+ if(InRect(mi->Rect, X, Y))
+ {
+ break;
+ }
+ mi = mi->Next;
+ }
+ ExReleaseFastMutexUnsafe(&MenuObject->MenuItemsLock);
+
+ IntReleaseMenuObject(MenuObject);
+
+ if(hWnd)
+ IntReleaseWindowObject(WindowObject);
+
+ return (mi ? i : -1);
}
-/* $Id: misc.c,v 1.44 2004/01/26 10:09:04 weiden Exp $
+/* $Id: misc.c,v 1.45 2004/01/26 12:46:16 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
switch(Routine)
{
+ case TWOPARAM_ROUTINE_SETMENUBARHEIGHT:
+ {
+ DWORD Ret;
+ PMENU_OBJECT MenuObject = IntGetMenuObject((HMENU)Param1);
+ if(!MenuObject)
+ return 0;
+ if(Param2 > 0)
+ MenuObject->Height = (int)Param2;
+ Ret = (DWORD)MenuObject->Height;
+ IntReleaseMenuObject(MenuObject);
+ return Ret;
+ }
case TWOPARAM_ROUTINE_SETMENUITEMRECT:
{
BOOL Ret;