MFC键盘消息
BOOL CDefaultBtnDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
char tBuf[10];
memset(tBuf,0x00,sizeof(tBuf));
if ((WM_KEYFIRST<pMsg->message) && (pMsg->message <WM_KEYLAST))
{
sprintf(tBuf,"%x",pMsg->wParam);
}
if((pMsg->message ==WM_KEYDOWN) && (pMsg->wParam ==VK_RETURN))
{
sprintf(tBuf,"%x",pMsg->wParam);
OnButton1();
pMsg->wParam = VK_LBUTTON;
}
return CDialog::PreTranslateMessage(pMsg);
}