User32GetMenuItemID(IntPtr, Int32) Method

Retrieves the menu item identifier of a menu item located at the specified position in a menu.

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")]
public static int GetMenuItemID(
	IntPtr hMenu,
	int nPos
)

Parameters

hMenu  IntPtr
A handle to the menu that contains the item whose identifier is to be retrieved.
nPos  Int32
The zero-based relative position of the menu item whose identifier is to be retrieved.

Return Value

Int32
The return value is the identifier of the specified menu item.

If the menu item identifier is Zero or if the specified item opens a submenu, the return value is -1.

Remarks

See Also