The GetMenuDefaultItem function determines the default menu item on the specified menu.
UINT GetMenuDefaultItem(
HMENU hMenu,
UINT fByPos,
UINT gmdiFlags
);
Value | Meaning |
---|---|
GMDI_GOINTOPOPUPS | Specifies that if the default item is one that opens a submenu, the function is to search recursively in the corresponding submenu. If the submenu has no default item, the return value identifies the item that opens the submenu. By default, the function returns the first default item on the specified menu, regardless of whether it is an item that opens a submenu. |
GMDI_USEDISABLED | Specifies that the function is to return a default item, even if it is disabled. By default, the function skips disabled or grayed items. |
If the function succeeds, the return value is the identifier or position of the menu item.
If the function fails, the return value is – 1. To get extended error information, call GetLastError.
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Menus Overview, Menu Functions, SetMenuDefaultItem