mfc键盘消息擒获
mfc键盘消息捕获
BOOL CWebEnterpriseCtrl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->wParam == WM_KEYDOWN)
{
if(GetKeyState(VK_CONTROL) < 0)
{
}
}
return COleControl::PreTranslateMessage(pMsg);
}
怎样添加捕获笔记本电脑中的+号键和-号键,首先,不是小键盘中的加号和减号键。
------解决方案--------------------
if( pMsg->message == WM_KEYDOWN )
{
if( pMsg->wParam == VK_OEM_PLUS )
{
AfxMessageBox(L"Add");
}
}
BOOL CWebEnterpriseCtrl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->wParam == WM_KEYDOWN)
{
if(GetKeyState(VK_CONTROL) < 0)
{
}
}
return COleControl::PreTranslateMessage(pMsg);
}
怎样添加捕获笔记本电脑中的+号键和-号键,首先,不是小键盘中的加号和减号键。
------解决方案--------------------
if( pMsg->message == WM_KEYDOWN )
{
if( pMsg->wParam == VK_OEM_PLUS )
{
AfxMessageBox(L"Add");
}
}