DeleteMenu

3.0

  BOOL DeleteMenu(hmenu, idItem, fuFlags)    
  HMENU hmenu; /* handle of menu, */  
  UINT idItem; /* menu-item identifier, */  
  UINT fuFlags; /* menu flags, */  

The DeleteMenu function deletes an item from a menu. If the menu item has an associated pop-up menu, DeleteMenu destroys the handle of the pop-up menu and frees the memory used by the pop-up menu.

Parameters

hmenu

Identifies the menu to be changed.

idItem

Specifies the menu item to be deleted, as determined by the fuFlags parameter.

fuFlags

Specifies how the idItem parameter is interpreted. This parameter can be one of the following values:

Value Meaning

MF_BYCOMMAND The idItem parameter specifies the menu-item identifier.
MF_BYPOSITION The idItem parameter specifies the zero-based relative position of the menu item.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

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

See Also

AppendMenu, CreateMenu, DrawMenuBar, InsertMenu, RemoveMenu