网站首页  词典首页

请输入您要查询的函数:

 

术语 getmenuiteminfo
释义 GetMenuItemInfo
语法:
BOOL GetMenuItemInfo( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPMENUITEMINFO lpmii
);
获取菜单项功能
在获取菜单项的信息检索功能菜单项。
参数
hMenu
[in]的菜单句柄包含菜单项。
uItem
[in]标识符或菜单项的位置来获得信息。这个参数的含义取决于fByPosition价值。
fByPosition
[in]指定uItem意义。如果此参数为FALSE,uItem是一个菜单项的标识符。否则,它是一个菜单项的位置。有关更多信息,菜单编程注意事项。
lpmii
[中,out]指向1 MENUITEMINFO结构,它指定了信息检索和获得有关信息的菜单项。请注意,您必须设置为sizeof MENUITEMINFO.cbSize在调用这个函数(MENUITEMINFO)。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,使用GetLastError函数。
备注
要检索类型MFT_STRING菜单项,首先找到通过设置MENUITEMINFO dwTypeData成员为NULL字符串的大小,然后调用获取菜单项。卫生协调委员会1值的大小需要。然后分配这个大小的缓冲区,放置指针在dwTypeData缓冲区,增加一个协调委员会,然后调用获取菜单项再次填充字符串缓冲区。
如果检索菜单项其他一些类型,那么获取菜单项设置dwTypeData成员到其指定类型的fTypefType卫生协调委员会成员,并设置值为0。
Windows 98/Me和Windows 2000/XP的:dwTypeData和协调委员会的使用MIIM_STRING。
在Windows 95/98/Me:GetMenuItemInfoW是支持微软层对于Unicode。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参见示例的所有者描述的菜单项。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 4.0
UnicodeImplemented为ANSI和Unicode版本。
参见
菜单,SetMenuItemInfo
==英文原文==GetMenuItemInfo Function
The GetMenuItemInfo function retrieves information about a menu item.
Syntax
BOOL GetMenuItemInfo( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPMENUITEMINFO lpmii
);
Parameters
hMenu
[in] Handle to the menu that contains the menu item.
uItem
[in] Identifier or position of the menu item to get information about. The meaning of this parameter depends on the value of fByPosition.
fByPosition
[in] Specifies the meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position. See Menu Programming Considerations for more information.
lpmii
[in, out] Pointer to a MENUITEMINFO structure that specifies the information to retrieve and receives information about the menu item. Note that you must set MENUITEMINFO.cbSize to sizeof(MENUITEMINFO) before calling this function.
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, use the GetLastError function.
Remarks
To retrieve a menu item of type MFT_STRING, first find the size of the string by setting the dwTypeData member of MENUITEMINFO to NULL and then calling GetMenuItemInfo. The value of cch+1 is the size needed. Then allocate a buffer of this size, place the pointer to the buffer in dwTypeData, increment cch by one, and then call GetMenuItemInfo once again to fill the buffer with the string.
If the retrieved menu item is of some other type, then GetMenuItemInfo sets the dwTypeData member to a value whose type is specified by the fTypefType member and sets cch to 0.
Windows 98/Me and Windows 2000/XP: dwTypeData and cch are used with MIIM_STRING.
Windows 95/98/Me: GetMenuItemInfoW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Example of Owner-Drawn Menu Items .
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 4.0
UnicodeImplemented as ANSI and Unicode versions.
See Also
Menus , SetMenuItemInfo
==原始网址==http://msdn.microsoft.com/en-us/library/ms647980(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 13:17:18