SetMenuItemBitmaps

3.0

  BOOL SetMenuItemBitmaps(hmenu, idItem, fuFlags, hbmUnchecked, hbmChecked)    
  HMENU hmenu; /* handle of menu, */  
  UINT idItem; /* menu-item identifier, */  
  UINT fuFlags; /* menu-item flags, */  
  HBITMAP hbmUnchecked; /* handle of unchecked bitmap */
  HBITMAP hbmChecked; /* handle of checked bitmap */

The SetMenuItemBitmaps function associates the given bitmaps with a menu item. Whether the menu item is checked or unchecked, Windows displays the appropriate check-mark bitmap next to the menu item.

Parameters

hmenu

Identifies the menu.

idItem

Specifies the menu item to be changed, 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 (default value).
MF_BYPOSITION The idItem parameter specifies the zero-based position of the menu item.

hbmUnchecked

Identifies the check-mark bitmap to display when the menu item is not checked.

hbmChecked

Identifies the check-mark bitmap to display when the menu item is checked.

Return Value

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

Comments

If either the hbmUnchecked or the hbmChecked parameter is NULL, Windows displays nothing next to the menu item for the corresponding attribute. If both parameters are NULL, Windows uses the default check mark when the item is checked and removes the check mark when the item is unchecked.

When the menu is destroyed, these bitmaps are not destroyed; the application must destroy them.

The GetMenuCheckMarkDimensions function retrieves the dimensions of the default check mark used for menu items. The application should use these values to determine the appropriate size for the bitmaps supplied with this function.

See Also

GetMenuCheckMarkDimensions