需要两步
1、调整按键消息
BOOL RobCarLicense_RobotInput2020Dlg::PreTranslateMessage(MSG* pMsg)
{
if (WM_KEYFIRST <= pMsg->message && pMsg->message <= WM_KEYLAST)
{
switch (pMsg->wParam)
{
case VK_F1:
{//屏蔽F1还需要屏蔽WinApp::OnHelp()
if (pMsg->message == WM_KEYUP)
{
...
}
else if (pMsg->message == WM_KEYDOWN)
{
...
}
return TRUE;//当返回值是FALSE时,消息会传递到下一级窗口。返回值TRUE时,消息会被拦截,不会被传递到下一级窗口。
}
}
}
}
2、
接受处理WM_HELPINFO 消息
BEGIN_MESSAGE_MAP(CXXXDlg, CDialog)
ON_WM_HELPINFO()
END_MESSAGE_MAP()
BOOL CXXXDlg::OnHelpInfo(HELPINFO* pHelpInfo)
{
//return CDialog::OnHelpInfo(pHelpInfo);
return TRUE;
}