在从CView继承的PreTranslateMessage(MSG*pMsg)中的MFC应用程序中,我有这个:if(pMsg->message==WM_KEYDOWN)...WM_KEYDOWN中的字段已记录here.虚拟键VK_的值在pMsg->wParam中,pMsg->lParam包含几个字段,其中第16-23位是键盘扫码。所以在我的代码中我使用:constintvirtualKey=pMsg->wParam;constinthardwareScanCode=(pMsg->lParam>>16)&0x00ff;//bits16-23例如,在我的非美式键盘上,当我按下“#”字符时,