User32EnableMenuItem(SafeHandle, UInt32, Int32) Method

Sets the state of the specified menu item.

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 bool EnableMenuItem(
	SafeHandle hMenu,
	uint uIDEnableItem,
	int uEnable
)

Parameters

hMenu  SafeHandle
A handle to the menu.
uIDEnableItem  UInt32
The menu item to be enabled, disabled, or grayed, as determined by the uEnable parameter.

This parameter specifies an item in a menu bar, menu, or submenu.

uEnable  Int32
Controls the interpretation of the uIDEnableItem parameter and indicate whether the menu item is enabled, disabled, or grayed.

Return Value

Boolean
The previous state of the menu item if it exists, or -1 otherwise.

Remarks

See Also