[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
AppendMenu( hMenu, nFlags, nPopHnd, xNewItem )-> <lSuccess>
------------------------------------------------------------------------------
PARAMETER:
<hMenu> Handle that identifies the menu to be changed
<nFlags> Specifies information about the state of the new menu
item when it is added to the menu. This parameter consists
of one or more of the listed values ( defined in MENU.PRG )
MF_BITMAP Uses a bitmap as the item. The low-order
word of <xNewItem> contains the handle of
the bitmap.
MF_CHECKED Places a check mark next to the item.
If the application has supplied check mark
bitmaps, setting this flag displays the
"check mark on" bitmap next to the menu item
MF_UNCHECKED Does not place a check mark next to the item
(default). If the application has supplied
check mark bitmaps, setting this flag
displays the "check mark off" bitmap next to
the menu item.
MF_DISABLED Disables the menu item so that it cannot be
selected, but does not gray it.
MF_ENABLED Enables the menu item, so that it can be
selected, and restores it from its grayed
state
MF_GRAYED Disables the menu item so that it cannot be
selected, and grays it.
MF_OWNERDRAW Specifies that the item is an owner-drawn
item. The window that owns the menu receives
a WM_MEASUREITEM message when the menu is
displayed for the first time to retrieve the
height and width of the menu item. The
WM_DRAWITEM message is then sent whenever
the owner window must update the visual
appearance of the menu item. This option is
not valid for a top-level menu item.
MF_POPUP Specifies that the menu item has a pop-up
menu associated with it. The idNewItem
parameter specifies a handle to a pop-up
menu to be associated with the item. This is
used for adding either a top-level pop-up
menu or adding a hierarchical pop-up menu to
a pop-up menu item.
MF_SEPARATOR Draws a horizontal dividing line. Can be
used only in a pop-up menu. This line cannot
be grayed, disabled, or highlighted.
The xNewItem parameter is ignored.
MF_STRING Specifies that the menu item is a character
string; the xNewItem parameter is the string
for the menu item prompt.
<nPopHnd> specifies either the command identifier constant of the new
menu item or, if the <nFlags> parameter is set to MF_POPUP,
the menu handle of the pop-up menu.
<xNewItem> is the content of the new menu item. This Parameter can be
a string, or a handle to a bitmap, or a Flag; depending on the
value of the <nFlags> parameter :
MF_STRING Contains a prompt string
MF_BITMAP Contains a bitmap handle in its low-order word.
MF_OWNERDRAW Contains an application-supplied 32-bit value
RETURNS:
The function returns TRUE if it is successful
DESCRIPTION:
The AppendMenu function appends a new item to the end of a menu. The
application can specify the state of the menu item by setting values in
the <nFlags> parameter.
Whenever a menu changes (whether or not the menu is in a window that is
displayed), the application should call the DrawMenuBar function
EXAMPLE:
+--------------------------------------------------------------+
| /* Append a menu item to a PopUp menu */ |
| AppendMenu( ::hMenu, nOr( MF_POPUP, MF_ENABLED),; |
| oMenuItem:bAction:hMenu, oMenuItem:cPrompt ) |
+--------------------------------------------------------------+
SOURCE:
SOURCE\WINAPI\MENUS.C
See Also:
CreateMenu
InsertMenu
DestroyMenu
DrawMenuBar
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson