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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function AppendMenu (
hMenu As IntPtr,
uFlags As UInteger,
uIDNewItem As UIntPtr,
lpNewItem As String
) As Boolean
Dim hMenu As IntPtr
Dim uFlags As UInteger
Dim uIDNewItem As UIntPtr
Dim lpNewItem As String
Dim returnValue As Boolean
returnValue = User32.AppendMenu(hMenu,
uFlags, uIDNewItem, lpNewItem)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool AppendMenu(
IntPtr hMenu,
unsigned int uFlags,
UIntPtr uIDNewItem,
String^ lpNewItem
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member AppendMenu :
hMenu : IntPtr *
uFlags : uint32 *
uIDNewItem : UIntPtr *
lpNewItem : string -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.