PreTranslateMessage 和 windowProc

CWnd::PreTranslateMessage
Used   by   class   CWinApp   to   translate   window   messages   before   they   are   dispatched   to   the   TranslateMessage   and   DispatchMessage   Windows   functions.

CWnd::WindowProc
Provides   a   Windows   procedure   (WindowProc)   for   a   CWnd   object.   It   dispatches   messages   through   the   window’s   message   map.

显然只有通过TranslateMessage和DispatchMessage函数传过来的消息才能在PreTranslateMessage中捕捉到,什么消息是通过这两个函数我不清楚,不过鼠标和键盘还有Timer是一定会过的!
还有就是所有的消息都通过WindowProc,所以只要重载这个函数就一定能得到你要的消息!

另外,PreTranslateMessage处理时如果return TRUE,表示消息仍然继续传递下去,而return FALSE,则消息不再往下传递。

另外,如果一个消息将会被两者都处理,则PreTranslateMessage会先于WindowProc执行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值