Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function appends a new item to the end of the specified menu. You can use AppendMenuto specify the content, appearance, and behavior of the menu item.
BOOL AppendMenu( HMENU hMenu , UINT uFlags , UINT uIDNewItem , LPCTSTR lpNewItem );
Parameters
Value | Description |
---|---|
MF_OWNERDRAW | Contains a 32-bit value supplied by the application that can be used to maintain additional data related to the menu item. The value is in the itemDatamember of the structure pointed to by the lparamparameter of the WM_MEASUREITEMor WM_DRAWITEMmessage sent when the menu is created or its appearance is updated. |
MF_STRING | Contains a pointer to a null-terminated string. |
Return Values
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Remarks
The application must call the DrawMenuBarfunction whenever a menu changes, whether or not the menu is in a displayed window.
To get keyboard accelerators to work with bitmap or owner-drawn menu items, the owner of the menu must process the WM_MENUCHARmessage.
The following flags can be set in the uFlagsparameter:
Windows CE versions 1.0 and 1.01 do not support this flag.
Windows CE versions 1.0 and 1.01 do not support this flag.
Windows CE versions 1.0 and 1.01 do not support this flag.
The following groups of flags cannot be used together:
Windows CE version 1.0 does not support cascading menus. If you are using Windows CE version 1.0, you cannot insert an MF_POPUP menu into another pop-up menu. In Windows CE versions 2.0 and later, cascading menus are supported.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winuser.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
CreateMenu, DeleteMenu, DestroyMenu, GetLastError, InsertMenu, RemoveMenu, WM_DRAWITEM, WM_MEASUREITEM, WM_MENUCHAR