DeleteMenu

Version 3.0

Syntax

BOOL DeleteMenu(hMenu,nPosition,wFlags)

This function deletes an item from the menu identified by the hMenu parameter; if the menu item has an associated pop-up menu, DeleteMenu destroys the handle by the pop-up menu and frees the memory used by the pop-up menu.

Parameter Type/Description  

hMenu HMENU Identifies the menu to be changed.  
nPosition WORD Specifies the menu item which is to be deleted. If wFlags is set to MF_BYPOSITION, nPosition specifies the position of the menu item; the first item in the menu is at position 0. If wFlags is set to MF_BYCOMMAND, then nPosition specifies the command ID of the existing menu item.  
wFlags WORD Specifies how the nPosition parameter is interpreted. It may be set to either MF_BYCOMMAND (the default) or MF_BYPOSITION.  

Return Value

The return value specifies the outcome of the function. It is TRUE if the function is successful. Otherwise, it is FALSE.

Comments

Whenever a menu changes (whether or not the menu resides in a window that is displayed), the application should call DrawMenuBar.