User32AppendMenu(IntPtr, UInt32, UIntPtr, String) Method

Appends a new item to the end of the specified menu bar, drop-down menu, submenu, or shortcut menu.

You can use this function to specify the content, appearance, and behavior of the 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", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool AppendMenu(
	IntPtr hMenu,
	uint uFlags,
	UIntPtr uIDNewItem,
	string lpNewItem
)

Parameters

hMenu  IntPtr
A handle to the menu bar, drop-down menu, submenu, or shortcut menu to be changed.
uFlags  UInt32
Controls the appearance and behavior of the new menu item.
uIDNewItem  UIntPtr
The identifier of the new menu item or, if the uFlags parameter is set to MF_POPUP a handle to the drop-down menu or submenu.
lpNewItem  String
The content of the new menu item.

Return Value

Boolean
If the function succeeds, the return is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also