网站首页  词典首页

请输入您要查询的函数:

 

术语 checkmenuitem
释义 CheckMenuItem
语法:
DWORD CheckMenuItem( HMENU hmenu,
UINT uIDCheckItem,
UINT uCheck
);
CheckMenuItem函数
该CheckMenuItem函数设置指定的菜单项的检查状态标记属性要么选择或清除。
参数
hmenu
[in]句柄感兴趣的菜单。
uIDCheckItem
[in]指定菜单项的检查标记属性被设置,由uCheck参数确定。
uCheck
[in]指定的标志控制的诠释uIDCheckItem参数和菜单项的检查状态标记属性。此参数可以是任何MF_BYCOMMAND或MF_BYPOSITION和MF_CHECKED或MF_UNCHECKED组合。
MF_BYCOMMAND
表明uIDCheckItem参数给出了菜单项的标识符。该MF_BYCOMMAND标志的情况下,如果既不是MF_BYCOMMAND或MF_BYPOSITION标志被指定。
MF_BYPOSITION
表明uIDCheckItem参数给出了基于零的菜单项的相对位置。
MF_CHECKED
设置检查标记属性选中状态。
MF_UNCHECKED
设置检查标记属性明确的状态。
返回值
返回值指定菜单项以前的状态(或者MF_CHECKED或MF_UNCHECKED)。如果该菜单项不存在,则返回值为-1。
备注
注意CheckMenuItem功能已被取代了SetMenuItemInfo功能。您仍然可以使用CheckMenuItem,但是,如果您不需要的SetMenuItemInfo扩展的任何功能。
在菜单栏项目不能有一个选中标记。
在uIDCheckItem参数标识1项,打开一个菜单或命令项。对于一个项目,打开一个子菜单,uIDCheckItem参数必须指定项目的立场。对于一个命令项,uIDCheckItem参数可以指定该项目的立场或其标识。
例如
有关示例,请参见模拟在菜单复选框。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
菜单,EnableMenuItem,GetMenuItemID,SetMenuItemBitmaps,SetMenuItemInfo
==英文原文==CheckMenuItem Function
The CheckMenuItem function sets the state of the specified menu item's check-mark attribute to either selected or clear.
Syntax
DWORD CheckMenuItem( HMENU hmenu,
UINT uIDCheckItem,
UINT uCheck
);
Parameters
hmenu
[in] Handle to the menu of interest.
uIDCheckItem
[in] Specifies the menu item whose check-mark attribute is to be set, as determined by the uCheck parameter.
uCheck
[in] Specifies flags 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 either MF_BYCOMMAND, or MF_BYPOSITION and MF_CHECKED or MF_UNCHECKED.
MF_BYCOMMAND
Indicates that the uIDCheckItem parameter gives the identifier of the menu item. The MF_BYCOMMAND flag is the default, if neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified.
MF_BYPOSITION
Indicates that the uIDCheckItem parameter gives the zero-based relative position of the menu item.
MF_CHECKED
Sets the check-mark attribute to the selected state.
MF_UNCHECKED
Sets the check-mark attribute to the clear state.
Return Value
The return value specifies the previous state of the menu item (either MF_CHECKED or MF_UNCHECKED). If the menu item does not exist, the return value is -1.
Remarks
Note The CheckMenuItem function has been superseded by the SetMenuItemInfo function. You can still use CheckMenuItem, however, if you do not need any of the extended features of SetMenuItemInfo.
An item in a menu bar cannot have a check mark.
The uIDCheckItem parameter identifies a item that opens a submenu or a command item. For a 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.
Example
For an example, see Simulating Check Boxes in a Menu .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Menus , EnableMenuItem , GetMenuItemID , SetMenuItemBitmaps , SetMenuItemInfo
==原始网址==http://msdn.microsoft.com/en-us/library/ms647619(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:26:58