VC,检测键盘上下翻页按键的问题
目的:检测键盘的PageDown和PageUp按键
问题:当按下PageDown或PageUp按键时,检测不到(即:两个if条件不成立)
在变量WATCH里也无法查看变量pMsg-> wParam的值,提示信息为:error in OMF type information。
代码如下:
BOOL CHP600Dlg::PreTranslateMessage(MSG* pMsg) {
if(pMsg-> wParam==SB_PAGEUP){
//do.....
}
if(pMsg-> wParam==SB_PAGEDOWN){
//do .......
}
}
请教大家!谢谢
[解决办法]
if(pMsg-> message == WM_KEYDOWN)
{
if(LOWORD(pMsg-> wParam) == VK_PRIOR)
{
AfxMessageBox( "up ");
}
else if(LOWORD(pMsg-> wParam) == VK_NEXT)
{
AfxMessageBox( "down ");
}
}