PreTranslateMessage这个函数在MFC中的什么时候运行啊?
它的运行机制是什么?

解决方案 »

  1.   

    在调用GetMessage 从消息队列获取消息之后,TranslateMessage之前调用。根据从消息队列获取消息里的窗口句柄,找到相应的窗口管理类(如CView等),调用PreTranslateMessage方法。
    CWnd有PreTranslateMessage的默认实现,并且该函数是虚函数,所以可以在CWnd的派生类中重载这个方法,这样就可以达到在TranslateMessage之前来处理消息的目的
      

  2.   

    就是在消息被Translate之前被调用
      

  3.   

    消息处理之前运行,消息循环在收到消息后,会新调用PreTranslateMessage,后发发送消息
      

  4.   

    Used by class CWinApp to translate window messages before they are dispatched to theTranslateMessage andDispatchMessage Windows functions.