GetMenuDefaultItem function (winuser.h)
Determines the default menu item on the specified menu.
Syntax
UINT GetMenuDefaultItem(
[in] HMENU hMenu,
[in] UINT fByPos,
[in] UINT gmdiFlags
);
Parameters
[in] hMenu
Type: HMENU
A handle to the menu for which to retrieve the default menu item.
[in] fByPos
Type: UINT
Indicates whether to retrieve the menu item's identifier or its position. If this parameter is FALSE, the identifier is returned. Otherwise, the position is returned.
[in] gmdiFlags
Type: UINT
Indicates how the function should search for menu items. This parameter can be zero or more of the following values.
Return value
Type: UINT
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |
API set | ext-ms-win-ntuser-menu-l1-1-0 (introduced in Windows 8) |
See also
Conceptual
Reference