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执行