Implementing Tooltips for Menus - 项目摘要 |
摘要
| 管理 |
论坛 文档
| 软件包 |
|
|
|
项目描述: |
All the changes to get the menu tip go to CMainFrame class. I first overrode both OnEnterMenuLoop and OnExitMenuLoop, furthermore OnEnterIdle and then FilterToolTipMessage. When a menu pops up, OnEnterMenuLoop is called, which then creates a WS_EX_TOPMOST style tooltip. The tooltip is updated by OnEnterIdle which passes fake WM_MOUSEMOVE messages to the tooltip using RelayEvent. I do need to override FilterToolTipMessage, because the MFC CWnd::FilterToolTipMessage does not create WS_EX_TOPMOST tooltips and therefore does NOT display the tooltip. It is important to define your own method !
生成菜单提示的所有变化都在 CMainFrame 类中完成。我先重载了 OnEnterMenuLoop 和 OnExitMenuLoop,再接着是 OnEnterIdle 和 then FilterToolTipMessage。一个菜单弹出时,调用 OnEnterMenuLoop ,它可以创建一个WS_EX_TOPMOST 风格的工具提示。工具提示由OnEnterIdle 来更新,它使用 RelayEvent传递伪 WM_MOUSEMOVE消息到工具提示中。我需要重载FilterToolTipMessage,因为MFC的CWnd::FilterToolTipMessage 不能创建 WS_EX_TOPMOST 工具提示,因此也不能显示工具提示。这对于定义你自己的方法是很重要的!
来源: http://www.codeguru.com/menu/menutip.html |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
menutip |
 1.0  |
2004-04-18 |
下载 |
|
|