[WIN32K]
[reactos.git] / reactos / win32ss / user / ntuser / menu.h
1 #pragma once
2
3 #define IS_ATOM(x) \
4 (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000))
5
6 #define MENU_ITEM_TYPE(flags) \
7 ((flags) & (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR))
8
9 #ifndef MF_END
10 #define MF_END (0x0080)
11 #endif
12
13 typedef struct _MENU_ITEM
14 {
15 struct _MENU_ITEM *Next;
16 UINT fType;
17 UINT fState;
18 UINT wID;
19 HMENU hSubMenu;
20 HBITMAP hbmpChecked;
21 HBITMAP hbmpUnchecked;
22 ULONG_PTR dwItemData;
23 UNICODE_STRING Text;
24 HBITMAP hbmpItem;
25 RECTL Rect;
26 UINT dxTab;
27 } MENU_ITEM, *PMENU_ITEM;
28
29 typedef struct _MENU_OBJECT
30 {
31 PROCDESKHEAD head;
32 PEPROCESS Process;
33 LIST_ENTRY ListEntry;
34 PMENU_ITEM MenuItemList;
35 ROSMENUINFO MenuInfo;
36 BOOL RtoL;
37 } MENU_OBJECT, *PMENU_OBJECT;
38
39 typedef struct _SETMENUITEMRECT
40 {
41 UINT uItem;
42 BOOL fByPosition;
43 RECTL rcRect;
44 } SETMENUITEMRECT, *PSETMENUITEMRECT;
45
46 PMENU_OBJECT FASTCALL
47 IntGetMenuObject(HMENU hMenu);
48
49 #define IntReleaseMenuObject(MenuObj) \
50 UserDereferenceObject(MenuObj)
51
52 BOOL FASTCALL
53 IntDestroyMenuObject(PMENU_OBJECT MenuObject, BOOL bRecurse, BOOL RemoveFromProcess);
54
55 PMENU_OBJECT FASTCALL
56 IntCloneMenu(PMENU_OBJECT Source);
57
58 int FASTCALL
59 IntGetMenuItemByFlag(PMENU_OBJECT MenuObject, UINT uSearchBy, UINT fFlag,
60 PMENU_OBJECT *SubMenu, PMENU_ITEM *MenuItem,
61 PMENU_ITEM *PrevMenuItem);
62
63 BOOL FASTCALL
64 IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
65
66 BOOL FASTCALL
67 IntInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, BOOL fByPosition,
68 PROSMENUITEMINFO ItemInfo);
69
70 PMENU_OBJECT FASTCALL
71 IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
72
73 UINT FASTCALL IntFindSubMenu(HMENU *hMenu, HMENU hSubTarget );
74 UINT FASTCALL IntGetMenuState( HMENU hMenu, UINT uId, UINT uFlags);
75