BOOL CXXXXXXX::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class int nVirtKey; if(pMsg->message == WM_KEYDOWN) { nVirtKey=(int)pMsg->wParam; nVirtKey是按入的键值,在十六进制范围内就return FALSE,否则return TRUE,不做消息分派 ................. } }
能说详细点吗?多谢!
{
// TODO: Add your specialized code here and/or call the base class
int nVirtKey;
if(pMsg->message == WM_KEYDOWN)
{
nVirtKey=(int)pMsg->wParam;
nVirtKey是按入的键值,在十六进制范围内就return FALSE,否则return TRUE,不做消息分派
.................
}
}
BOOL CDialog::PreTranslateMessage(LPMSG pMsg)
{
if (pMsg->message == WM_KEYDOWN &&
pMsg->hwnd == m_Edit.GetSaftHwnd())
{
....
//pMsg->wPara是按键的ASCII,
//可在此处理你需要的字符
}
}