刘华世的官方博客

C++语言 无法通过Esc键关闭窗体

复制代码
BOOL CWelcomeDlg::PreTranslateMessage(MSG* pMsg) //Called to filter messages before they are dispatched
{
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_KEYDOWN && pMsg->wParam == 27)
    {
        CString s;
        s.Format("The wParam= %d The message = %d", pMsg->wParam, pMsg->message);
        MessageBox(s);
        return NULL;
    }
    return CDialog::PreTranslateMessage(pMsg);
}
在消息调用之前的函数
复制代码
posted @   pythonschool  阅读(357)  评论(0编辑  收藏  举报
努力加载评论中...
刘华世的官方博客
点击右上角即可分享
微信分享提示