uLib
User mode C/C++ extended API library for Win32 programmers.
|
Additional menu APIs...
Macros | |
#define | MIIM_ALL |
#define | AddMenuSeparator(hSubMenu) AddMenuItem( hSubMenu, 999, NULL, (-1), 0, NULL, NULL ) |
Typedefs | |
typedef bool(__stdcall * | PFnMenuItemAction) (HMENU hMenu, MENUITEMINFO *pInfo, PVOID Ctx) |
Functions | |
HMENU | LoadMenuEx (HMODULE hModule, CSTR Id, LANGID Language) |
HMENU | AddSubMenu (HMENU hMenu, UINT Index, CSTR Text, WORD Id=0, WORD State=0, PVOID Data=NULL, HBITMAP Image=NULL) |
bool | AddMenuItem (HMENU hMenu, UINT Index, CSTR Text, WORD cmdId, WORD State=0, PVOID Data=NULL, HBITMAP Image=NULL) |
int | GetMenuItemIdByName (HMENU hMenu, CSTR Name) |
LPMENUITEMINFO | GetMenuItemByName (HMENU hMenu, CSTR Name) |
PVOID | GetMenuItemData (HMENU hMenu, UINT Id) |
bool | SetMenuItemCheck (HMENU hMenu, UINT Id, bool Check) |
UINT | EnumerateMenuItems (HMENU hMenu, PFnMenuItemAction Action, PVOID Ctx) |
#define MIIM_ALL |
Combination of all valid MIIM_nnn flags.
Definition at line 1326 of file UtilFunc.h.
#define AddMenuSeparator | ( | hSubMenu | ) | AddMenuItem( hSubMenu, 999, NULL, (-1), 0, NULL, NULL ) |
Definition at line 1366 of file UtilFunc.h.
typedef bool(__stdcall * PFnMenuItemAction) (HMENU hMenu, MENUITEMINFO *pInfo, PVOID Ctx) |
Action callback for EnumerateMenuItems().
Definition at line 1388 of file UtilFunc.h.
HMENU LoadMenuEx | ( | HMODULE | hModule, |
CSTR | Id, | ||
LANGID | Language | ||
) |
LoadMenuEx loads an internationalized menu resource.
On error it returns null and GetLastError() has the cause.
If the menu resource doesn't exist the code is ERROR_INVALID_PARAMETER.
Definition at line 639 of file UserUtil.cpp.
HMENU AddSubMenu | ( | HMENU | hMenu, |
UINT | Index, | ||
CSTR | Text, | ||
WORD | Id = 0 , |
||
WORD | State = 0 , |
||
PVOID | Data = NULL , |
||
HBITMAP | Image = NULL |
||
) |
Create a new popup menu and insert it in a given menu.
hMenu | The menu to recieve a new submenu. |
Index | Submenu position in hMenu. Use UINT(-1) to append. |
Text | Name of the new submenu. |
Id | [opt] Id of the new submenu. |
State | [opt] State flags (MFS_nnn). |
Data | [opt] Arbitrary data. |
Image | [opt] Bitmap to use. Must persist the executable lifetime. |
Definition at line 718 of file UserUtil.cpp.
bool AddMenuItem | ( | HMENU | hMenu, |
UINT | Index, | ||
CSTR | Text, | ||
WORD | cmdId, | ||
WORD | State = 0 , |
||
PVOID | Data = NULL , |
||
HBITMAP | Image = NULL |
||
) |
Add a new menu item with optional paraphernalia to a given menu.
hMenu | The menu to recieve a new item. |
Index | Item position in hMenu. Use UINT(-1) to append. |
Text | Name of the item. |
cmdId | Command id of the item. |
State | [opt] State flags (MFS_nnn). |
Data | [opt] Arbitrary data. |
Image | [opt] Bitmap to use. Must be persistent. |
Definition at line 767 of file UserUtil.cpp.
int GetMenuItemIdByName | ( | HMENU | hMenu, |
CSTR | Name | ||
) |
Find menu command/id by it's name.
See also GetMenuItemByName().
Definition at line 673 of file UserUtil.cpp.
LPMENUITEMINFO GetMenuItemByName | ( | HMENU | hMenu, |
CSTR | Name | ||
) |
Find menu item info by it's name.
Definition at line 650 of file UserUtil.cpp.
PVOID GetMenuItemData | ( | HMENU | hMenu, |
UINT | Id | ||
) |
Get menu item data, if any..
Return NULL if none.
Definition at line 681 of file UserUtil.cpp.
bool SetMenuItemCheck | ( | HMENU | hMenu, |
UINT | Id, | ||
bool | Check | ||
) |
Check/unckeck a menu item.
Definition at line 694 of file UserUtil.cpp.
UINT EnumerateMenuItems | ( | HMENU | hMenu, |
PFnMenuItemAction | Action, | ||
PVOID | Ctx | ||
) |
Enumerate the items in a menu..
Definition at line 806 of file UserUtil.cpp.