User32GetMenuState(SafeHandle, UInt32, MenuPosition) Method

Note: This API is now obsolete.
Retrieves the menu flags associated with the specified menu item.

If the menu item opens a submenu, this function also returns the number of items in the submenu.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll")]
[ObsoleteAttribute("The GetMenuState function has been superseded by the GetMenuItemInfo. You can still use GetMenuState, however, if you do not need any of the extended features of GetMenuItemInfo.", 
	false)]
public static uint GetMenuState(
	SafeHandle hMenu,
	uint uId,
	MenuPosition uFlags
)

Parameters

hMenu  SafeHandle
A handle to the menu that contains the menu item whose flags are to be retrieved.
uId  UInt32
The menu item for which the menu flags are to be retrieved, as determined by the uFlags parameter.
uFlags  MenuPosition
Indicates how the uId parameter is interpreted.

Return Value

UInt32
If the specified item does not exist, the return value is -1.

If the menu item opens a submenu, the low-order byte of the return value contains the menu flags associated with the item, and the high-order byte contains the number of items in the submenu opened by the item.

Otherwise, the return value is a mask (Bitwise OR) of the menu flags.

Remarks

See Also