对于对话框类无法直接使用WM_KEYDOWN
需要使用PreTranslateMessage()
例如对↑键 按下进行响应
BOOL CMy12354Dlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN)
if(pMsg->wParam == VK_UP)
{
MessageBox("hi");
}
return CDialog::PreTranslateMessage(pMsg);
}
浙公网安备 33010602011771号