CMenu::DeleteMenu

BOOL DeleteMenu( UINT nPosition, UINT nFlags );

Return Value

Nonzero if the function is successful; otherwise 0.

Parameters

nPosition

Specifies the menu item that is to be deleted, as determined by nFlags.

nFlags

Is used to interpret nPosition in the following way:

nFlags Interpretation of nPosition
MF_BYCOMMAND Specifies that the parameter gives the command ID of the existing menu item. This is the default if neither MF_BYCOMMAND nor MF_BYPOSITION is set.
MF_BYPOSITION Specifies that the parameter gives the position of the existing menu item. The first item is at position 0.

Remarks

Deletes an item from the menu. If the menu item has an associated pop-up menu, DeleteMenu destroys the handle to the pop-up menu and frees the memory used by the pop-up menu.

Whenever a menu that resides in a window is changed (whether or not the window is displayed), the application must call CWnd::DrawMenuBar.

CMenu OverviewClass MembersHierarchy Chart

See Also   CWnd::DrawMenuBar, ::DeleteMenu