您的位置:首页 > 其它

菜单绘制遇到的一点问题

2009-03-11 18:03 204 查看

WM_CANCELMODE

The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.

WM_ENTERIDLE

The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.
WM_ENTERIDLE
fuSource = wParam;    // idle-source flag
hwnd = (HWND) lParam; // handle of dialog box or owner window

我们一般使用TrackPopupMenuEx弹出菜单,问题的关键是,在菜单未关闭时,TrackPopupMenuEx并不返回,并拦截鼠标和键盘消息,

使用spy可以看到,此时的工具栏收不到任何消息,当然无从改变热点

在WM_ENTERIDLE响应函数中发送此消息即可达到目的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: