我用子类化方法修改菜单项,为什么有时没有修改的菜单项也会被修改?

glyc 2004-11-22 03:21:32
我在子类化窗口中修改菜单项,只有顶层菜单设置了自绘样式,有时发现二级菜单也被设置成了自绘样式,但是我没有在WM_DRAWITEM中处理,所以没有绘制出来。
请问这是怎么一回事呢?

我是用SetMenuItemInfo修改菜单的。
...全文
84 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
glyc 2004-11-23
  • 打赏
  • 举报
回复
怎么一天都过去了,还没有人响应?
顶一下。
glyc 2004-11-22
  • 打赏
  • 举报
回复
我在设置时指定不处理子菜单的。
这个问题也不是每次都出现。
老夏Max 2004-11-22
  • 打赏
  • 举报
回复
The SetMenuItemInfo function changes information about a menu item.

BOOL SetMenuItemInfo(
HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPMENUITEMINFO lpmii
);

Parameters
hMenu
Handle to the menu that contains the menu item.
uItem
Identifier or position of the menu item to change. The meaning of this parameter depends on the value of fByPosition.
fByPosition
Value specifying the meaning of uItem. If this parameter is FALSE, uItem is a menu item identifier. Otherwise, it is a menu item position.
lpmii
Pointer to a MENUITEMINFO structure that contains information about the menu item and specifies which menu item attributes to change.
可能是hMenu 就包含了你所设置的菜单的句柄,包含了子菜单!!

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧