BOOL DeleteMenu(hmenu, uItem, fuFlag) | |||||
HMENU hmenu; | /* handle of menu | */ | |||
UINT uItem; | /* menu-item identifier or position | */ | |||
UINT fuFlag; | /* menu-item flag | */ |
The DeleteMenu function deletes an item from the given menu. If the menu item invokes a pop-up menu, DeleteMenu destroys the handle of the pop-up menu and frees the memory used by the pop-up menu.
hmenu
Identifies the menu to be changed.
uItem
Specifies the menu item to be deleted, as determined by the fuFlag parameter.
fuFlag
Specifies how the uItem parameter is interpreted. This parameter can 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. |
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.
Whenever a menu changes (whether or not the menu is in a window that is displayed), the application should call DrawMenuBar.
DrawMenuBar, RemoveMenu