捕获Esc按键消息

来源:互联网 发布:sql中in的用法 编辑:程序博客网 时间:2024/06/03 19:37
BOOL CsiphelloDlg::PreTranslateMessage(MSG* pMsg)
{
    
// TODO: Add your specialized code here and/or call the base class
    
//过滤Esc按键
    if(((pMsg->message == WM_KEYDOWN) || (pMsg->message == WM_KEYUP))   &&   (pMsg->wParam   ==   VK_ESCAPE))  
    
{  
        
return TRUE;  
    }
 

    
return CDialog::PreTranslateMessage(pMsg);
}
 重载CDialog的PreTranslateMessage消息,它会在消息分发之前被调用。
原创粉丝点击