BOOL DeleteMenu( UINT nPosition, UINT nFlags );
nPosition
Specifies the menu item that is to be deleted, as determined by nFlags.
nFlags
The following list shows how nFlags is used to interpret nPosition.
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). |
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.
TRUE if the function is successful; otherwise FALSE.
CWnd::DrawMenuBar, ::DeleteMenu