15,979
社区成员
发帖
与我相关
我的任务
分享
if (pMsg->message == WM_KEYDOWN) {
if (GetDlgItem(IDC_EDIT1)==GetFocus())
{
if( pMsg->wParam==VK_RETURN)
{
AfxMessageBox(_T("按键成功"));
}
}
}
BOOL CXXXDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(GetDlgItem(IDC_EDIT1)->GetSafeHwnd() == pMsg->hwnd && WM_KEYDOWN == pMsg->message && VK_RETURN == pMsg->wParam)
{
AfxMessageBox(_T("Enter Press!"));
}
return CDialog::PreTranslateMessage(pMsg);
}