非模态对话框是不是收不到WM_MOUSEWHEEL消息

DrSmart 2010-12-08 05:25:25
非模态对话框是不是收不到WM_MOUSEWHEEL消息,重载这个,打印个消息框,没有弹出。

怎么才能响应这个消息呢?
...全文
281 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
好吧,我还是转发消息算了,主要是看看有啥优雅点的没,呵呵,谢谢大家。
  • 打赏
  • 举报
回复
消息被父窗口捕获了
疯狂石头_ 2010-12-08
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 drsmart 的回复:]
我的环境是,非模态是一个内嵌的,子的,没有边框设置为child类型的非模态对话框,
[/Quote]
你在内嵌子对话框和父对话框上扑捉WM_MOUSEWHEEL看看
Eleven 2010-12-08
  • 打赏
  • 举报
回复
The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.

A window receives this message through its WindowProc function.
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 a19860903 的回复:]
不知道楼主代码怎么写的,我刚刚试了下是可以的
[/Quote]

我的环境是,非模态是一个内嵌的,子的,没有边框设置为child类型的非模态对话框,
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
貌似,主对话框可以收到,除了出的转发消息外,还有啥正常点的方法,就是说优雅点的
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 yihandrensunyong 的回复:]
楼主 可以参考http://topic.csdn.net/u/20070523/12/aa3add01-fb61-4f8b-8e5c-14d87da12a1a.html
[/Quote]

hook效率太低了,不想用,也够敏感的,大家还有啥常规的方法吗
疯狂石头_ 2010-12-08
  • 打赏
  • 举报
回复
不知道楼主代码怎么写的,我刚刚试了下是可以的
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
OnChildNotify 下也没捕获到,郁闷了, 看看还有啥更好的方法没,不了解mfc的消息,据说还有反射消息啥的,能行吗,非模态对话框奇怪了
DrSmart 2010-12-08
  • 打赏
  • 举报
回复
BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_MOUSEWHEEL)
{
AfxMessageBox("a");
}
return CDialog::PreTranslateMessage(pMsg);
}

这里试了,非模态下,没有收到,还有没有其他方法了,郁闷了,是不是和焦点有关
yihandrensunyong 2010-12-08
  • 打赏
  • 举报
回复
BAIDU 搜索WM__MOUSEWHEEL 可以找到很多
yihandrensunyong 2010-12-08
  • 打赏
  • 举报
回复
楼主 可以参考http://topic.csdn.net/u/20070523/12/aa3add01-fb61-4f8b-8e5c-14d87da12a1a.html
yihandrensunyong 2010-12-08
  • 打赏
  • 举报
回复
能收到 BOOL CDownLoadDlg::PreTranslateMessage(MSG* pMsg) 这个函数来接受

15,979

社区成员

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

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