Menu::InsertMenu

Description

Inserts a menu item at a specified position(internal menu)


Inserts a menu item at a specified position(resource menu)

Syntax

BOOL InsertMenu( LPCTSTR lpcszNewItem, UINT nPosition, Function fnHandler, UINT nFlags = MF_STRING )

BOOL InsertMenu( UINT nPosition, UINT nFlags, UINT nIDNewItem = 0, LPCTSTR lpcszNewItem = NULL )

Parameters

lpcszNewItem
the string value of the newly inserted menu item
nPosition
items position index
fnHandler
the handler function for the newly inserted item
nFlags
flag to identify the item type, could be one of the following MF_STRING ,MF_ENABLED ,MF_GRAYED ,MF_DISABLED ,MF_UNCHECKED ,MF_CHECKED ,MF_SEPARATOR

nPosition
items command ID or index
nFlags
flag to indicate if nPosition is command ID or index,
could be one of the following, MF_BYCOMMAND or MF_BYPOSITION. Default is MF_BYCOMMAND
nIDNewItem
the command ID of the newly inserted item
lpcszNewItem
the string value of the newly inserted menu item

Return

returns true if successful else false.


returns true if successful else false.

Examples

Remark

See Also

header to Include

Control.h