CWinApp::PreTranslateMessage 的使用

该函数为CWinApp的虚拟函数,默认做TranslateMessage的工作,
若用户想在mfc架构下对来自于消息队列的消息有所预操作的要求,可以重载该函数。比如:废除鼠标、键盘消息.。
BOOL CXXXApp::PreTranslateMessage(MSG* pMsg)
{
        if (pMsg->message == WM_LBUTTONDOWN        ||
            pMsg->message == WM_LBUTTONUP          ||
            pMsg->message == WM_MOUSEMOVE          ||
            pMsg->message == WM_KEYDOWN            ||
            pMsg->message == WM_KEYUP            )
        {
            return TRUE;
        }

    return CWinApp::PreTranslateMessage(pMsg);
}
posted @ 2009-08-25 13:42  eric_lgf  阅读(557)  评论(0编辑  收藏  举报