Share via


A version of this page is also available for

Windows Embedded CE 6.0 R3


This function sets the state of the specified menu item's check mark attribute to either checked or unchecked.


DWORD CheckMenuItem(
  HMENU hmenu, 
  UINT uIDCheckItem, 
  UINT uCheck 


  • hmenu
    [in] Handle to the menu of interest.
  • uIDCheckItem
    [in] The menu item for which the check mark attribute is to be set, as determined by the uCheck parameter.
  • uCheck
    [in] Constants that control the interpretation of the uIDCheckItem parameter and the state of the menu item's check mark attribute. This parameter can be a combination of MF_BYCOMMAND or MF_BYPOSITION and MF_CHECKED or MF_UNCHECKED. For more information, see Menus Constants.

Return Value

The return value specifies the previous state of the menu item (either MF_CHECKED or MF_UNCHECKED). 0xFFFFFFFF indicates that the menu item does not exist.


An item in a menu bar cannot have a check mark.

The uIDCheckItem parameter identifies an item that opens a submenu or a command item. For an item that opens a submenu, the uIDCheckItem parameter must specify the position of the item. For a command item, the uIDCheckItem parameter can specify either the item's position or its identifier.


Header winuser.h
Library Menu.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also


Menus Functions
Menus Constants