BOOL RemoveMenu(hMenu,nPosition,wFlags)
This function deletes an menu item with an associated pop-up menu from the menu identified by the hMenu parameter but does not destroy the handle for the pop-up menu, allowing the menu to be reused. Before calling this function, the application should call GetSubMenu to retrieve the pop-up menu handle.
Parameter | Type/Description |
hMenu | HMENU Identifies the menu to be changed. | ||
nPosition | WORD Specifies the menu item to be removed. The interpretation of the nPosition parameter depends upon the setting of the wFlags parameter. | ||
If wFlags is: | nPosition | ||
MF_BYCOMMAND | Specifies the command ID of the existing menu item. | ||
MF_BYPOSITION | Specifies the position of the menu item. The first item in the menu is at position zero. | ||
wFlags | WORD Specifies how the nPosition parameter is interpreted. It must be either MF_BYCOMMAND or MF_BYPOSITION. |
The return value specifies the outcome of the function. It is TRUE if the function is successful. Otherwise, it is FALSE.
Whenever a menu changes (whether or not the menu resides in a window that is displayed), the application should call DrawMenuBar.