RemoveMenu

  BOOL RemoveMenu(hmenu, uItem, fuFlags)    
  HMENU hmenu; /* handle of menu */
  UINT uItem; /* menu-item identifier or position */
  UINT fuFlags; /* menu-item flag */

The RemoveMenu function deletes a menu item from the given menu. If the menu item invokes a pop-up menu, RemoveMenu does not destroy the pop-up menu or its handle, allowing the menu to be reused. Before calling this function, an application should call the GetSubMenu function to retrieve the handle of the pop-up menu.

Parameters

hmenu

Identifies the menu to be changed.

uItem

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

fuFlags

Specifies how the uItem parameter is interpreted. This parameter may be one of the following values:

Value Meaning

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

Return Value

The return value is TRUE if the function is successful or FALSE if an error occurs. To obtain extended error information, use the GetLastError function.

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

CreatePopupMenu, DeleteMenu, DrawMenuBar, GetSubMenu