次の方法で共有


CheckMenuItem (Compact 2013)

3/28/2014

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

See Also

Reference

Menu Functions
EnableMenuItem
Menu Constants