网站首页  词典首页

请输入您要查询的函数:

 

术语 insertmenuitem
释义 InsertMenuItem
语法:
BOOL InsertMenuItem( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPCMENUITEMINFO lpmii
);
InsertMenuItem功能
该InsertMenuItem函数插入一个新的菜单项在菜单中指定位置。
参数
hMenu
[in]句柄在新的菜单项插入菜单。
uItem
[in]标识符或菜单项的前插入新项目的立场。这个参数的含义取决于fByPosition价值。
fByPosition
[in]值指明uItem意义。如果此参数为FALSE,uItem是一个菜单项的标识符。否则,它是一个菜单项的位置。有关更多信息,菜单编程注意事项。
lpmii
[in]指向1 MENUITEMINFO结构,其中包含有关新的菜单项的信息。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,使用GetLastError函数。
备注
应用程序必须调用函数DrawMenuBar每当菜单更改,是否在菜单上显示的窗口。
在键盘加速器为了与位图或自行绘制的菜单项,菜单的拥有者必须处理WM_MENUCHAR消息。见所有者描述的菜单和有关更多信息,WM_MENUCHAR消息。
在Windows 95/98/Me:InsertMenuItemW是支持微软层对于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版本。
参见
菜单,DrawMenuBar,MENUITEMINFO
==英文原文==InsertMenuItem Function
The InsertMenuItem function inserts a new menu item at the specified position in a menu.
Syntax
BOOL InsertMenuItem( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPCMENUITEMINFO lpmii
);
Parameters
hMenu
[in] Handle to the menu in which the new menu item is inserted.
uItem
[in] Identifier or position of the menu item before which to insert the new item. The meaning of this parameter depends on the value of fByPosition.
fByPosition
[in] Value specifying 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] Pointer to a MENUITEMINFO structure that contains information about the new menu item.
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
The application must call the DrawMenuBar function whenever a menu changes, whether or not the menu is in a displayed window.
In order for keyboard accelerators to work with bitmap or owner-drawn menu items, the owner of the menu must process the WM_MENUCHAR message. See Owner-Drawn Menus and the WM_MENUCHAR Message for more information.
Windows 95/98/Me: InsertMenuItemW 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 Menu-Item Bitmaps .
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 , DrawMenuBar , MENUITEMINFO
==原始网址==http://msdn.microsoft.com/en-us/library/ms647988(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:24:31