网站首页  词典首页

请输入您要查询的函数:

 

术语 setmenuitembitmaps
释义 SetMenuItemBitmaps
语法:
BOOL SetMenuItemBitmaps( HMENU hMenu,
UINT uPosition,
UINT uFlags,
HBITMAP hBitmapUnchecked,
HBITMAP hBitmapChecked
);
SetMenuItemBitmaps函数
该联营公司SetMenuItemBitmaps函数与菜单项指定的位图。菜单项是否被选中或清除,系统会显示相应的位图旁边的菜单项。
参数
hMenu
[in]句柄菜单包含的项目以接收新的检查标志位图。
uPosition
[in]指定菜单项的改变,由uFlags参数确定。
uFlags
[in]指定如何uPosition参数解释。在uFlags参数必须是下列值之一。
MF_BYCOMMAND
指示uPosition给出了菜单项的标识符。如果没有MF_BYCOMMAND或MF_BYPOSITION指定,MF_BYCOMMAND是默认的标志。
MF_BYPOSITION
指示uPosition使从零开始的菜单项的相对位置。
hBitmapUnchecked
[in]位图的句柄时显示的菜单项没有被选中。
hBitmapChecked
[in]位图的句柄时显示菜单项被选中。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果该hBitmapUnchecked或hBitmapChecked参数是NULL,系统会显示没有相应的检查状态旁边的菜单项。如果这两个参数是NULL,则系统会显示默认的检查标志位图时,该项目被选中,并删除该项目时,没有选择的位图。
当菜单被销毁,这些位图不会被破坏,它是由应用程序对它们进行破坏。
选定的和明确的,应单色位图。该系统使用布尔及经营者结合起来,菜单,使白色部分变得透明和黑色部分位图成为该菜单项的颜色。如果您使用的颜色位图,结果可能是不可取的。
使用与CXMENUCHECK和CYMENUCHECK GetSystemMetrics函数值来检索位图的尺寸。
例如
有关示例,请参见模拟在菜单复选框。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
菜单
==英文原文==SetMenuItemBitmaps Function
The SetMenuItemBitmaps function associates the specified bitmap with a menu item. Whether the menu item is selected or clear, the system displays the appropriate bitmap next to the menu item.
Syntax
BOOL SetMenuItemBitmaps( HMENU hMenu,
UINT uPosition,
UINT uFlags,
HBITMAP hBitmapUnchecked,
HBITMAP hBitmapChecked
);
Parameters
hMenu
[in] Handle to the menu containing the item to receive new check-mark bitmaps.
uPosition
[in] Specifies the menu item to be changed, as determined by the uFlags parameter.
uFlags
[in] Specifies how the uPosition parameter is interpreted. The uFlags parameter must be one of the following values.
MF_BYCOMMAND
Indicates that uPosition gives the identifier of the menu item. If neither MF_BYCOMMAND nor MF_BYPOSITION is specified, MF_BYCOMMAND is the default flag.
MF_BYPOSITION
Indicates that uPosition gives the zero-based relative position of the menu item.
hBitmapUnchecked
[in] Handle to the bitmap displayed when the menu item is not selected.
hBitmapChecked
[in] Handle to the bitmap displayed when the menu item is selected.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
If either the hBitmapUnchecked or hBitmapChecked parameter is NULL, the system displays nothing next to the menu item for the corresponding check state. If both parameters are NULL, the system displays the default check-mark bitmap when the item is selected, and removes the bitmap when the item is not selected.
When the menu is destroyed, these bitmaps are not destroyed; it is up to the application to destroy them.
The selected and clear bitmaps should be monochrome. The system uses the Boolean AND operator to combine bitmaps with the menu so that the white part becomes transparent and the black part becomes the menu-item color. If you use color bitmaps, the results may be undesirable.
Use the GetSystemMetrics function with the CXMENUCHECK and CYMENUCHECK values to retrieve the bitmap dimensions.
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
==原始网址==http://msdn.microsoft.com/en-us/library/ms647998(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:24:14