Share via


CheckMenuItem

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

Syntax

DWORD CheckMenuItem(
  HMENU hmenu, 
  UINT uIDCheckItem, 
  UINT uCheck 
); 

Parameters

  • 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.

Remarks

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.

Requirements

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

Reference

EnableMenuItem
Menus Functions
Menus Constants