请进, 请帮我看看

hustlee 2001-07-24 10:05:14
InsertMenu(hMenuMain ,(UINT)3 , MF_BYPOSITION|MF_STRING|MF_POPUP,
(UINT)hMenuAlign , "格式(&M)");
怎么理解这句话


...全文
46 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
whiskers 2001-07-24
MF_STRING MF_BYPOSITION , MF_POPUP是宏定义阿,类型就是UINT
回复
softech 2001-07-24
The following list describes the flags that can be set in the uFlags parameter:

MF_CHECKED
Places a check mark next to the menu item.
MF_ENABLED
Enables the menu item so that it can be selected and restores it from its grayed state.
MF_GRAYED
Disables the menu item and grays it so it cannot be selected.
MF_MENUBARBREAK
Functions the same as the MF_MENUBREAK flag for a menu bar. For a drop-down menu, submenu, or shortcut menu, the new column is separated from the old column by a vertical line.
Windows CE versions 1.0 and 1.01 do not support this flag.

MF_MENUBREAK
Places the item on a new line (for menu bars) or in a new column (for a drop-down menu, submenu, or shortcut menu) without separating columns.
Windows CE versions 1.0 and 1.01 do not support this flag.

MF_OWNERDRAW
Specifies that the item is an owner-drawn item. Before the menu is displayed for the first time, the window that owns the menu receives a WM_MEASUREITEM message to retrieve the width and height of the menu item. The WM_DRAWITEM message is then sent to the window procedure of the owner window whenever the appearance of the menu item must be updated.
MF_POPUP
Specifies that the menu item opens a drop-down menu or submenu. The uIDNewItem parameter specifies the handle to the drop-down menu or submenu. This flag is used to add a menu name to a menu bar or a menu item that opens a submenu to a drop-down menu, submenu, or shortcut menu.
Windows CE versions 1.0 and 1.01 do not support this flag.

MF_SEPARATOR
Draws a horizontal dividing line. This flag is used only in a drop-down menu, submenu, or shortcut menu. The line cannot be grayed, disabled, or highlighted. The lpNewItem and uIDNewItem parameters are ignored.
MF_STRING
Specifies that the menu item is a text string; the lpNewItem parameter points to the string.
MF_UNCHECKED
Does not place a check mark next to the menu item (default).
The following groups of flags cannot be used together:

MF_BYCOMMAND and MF_BYPOSITION
MF_ENABLED and MF_GRAYED
MF_STRING, MF_OWNERDRAW, and MF_SEPARATOR
MF_MENUBARBREAK and MF_MENUBREAK
MF_CHECKED and MF_UNCHECKED
Menu items cannot be disabled without being grayed. To disable a menu item, use the MF_GRAYED flag.
回复
iamxgp 2001-07-24
BOOL InsertMenu(
HMENU hMenu, // handle to menu
UINT uPosition, // menu item that new menu item precedes
UINT uFlags, // menu item flags
UINT uIDNewItem, // menu item identifier or handle to drop-down
// menu or submenu
LPCTSTR lpNewItem // menu item content
);

Parameters
hMenu
Handle to the menu to be changed.
uPosition
Specifies the menu item before which the new menu item is to be inserted, as determined by the uFlags parameter.
uFlags
Specifies flags that control the interpretation of the uPosition parameter and the content, appearance, and behavior of the new menu item. This parameter must be a combination of one of the following required values and at least one of the values listed in the following Remarks section. Value Description
MF_BYCOMMAND Indicates that the uPosition 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 uPosition parameter gives the zero-based relative position of the new menu item. If uPosition is 0xFFFFFFFF, the new menu item is appended to the end of the menu
回复
hustlee 2001-07-24
能不能给我解析一下MF_STRING MF_BYPOSITION , MF_POPUP,吗?我在MSDN查的这个位置是uint uflags 参数。
回复
whiskers 2001-07-24
在主菜单中插入一个菜单项,名称为"格式",快捷方式为ALT+M,是弹出式菜单
回复
hustlee 2001-07-24
GZ
回复
相关推荐
发帖
VC/MFC
创建于2007-09-28

1.5w+

社区成员

VC/MFC相关问题讨论
申请成为版主
帖子事件
创建了帖子
2001-07-24 10:05
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……