This test works for me : (test Beep if Numpad (0-9 and +/-))
case WM_CHAR:
{
UINT nScanCode = LOBYTE(HIWORD(lParam));
if (nScanCode >= 0x47 && nScanCode <= 0x52)
Beep(6000, 10);
}
break;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How to tell key events of num key pressing down from main key area and num key area in Win32 application?
Exactly the top num keys and those on right-hand side. I've used WM_CHAR to get key events but it fails to distinguish them. They actually have the same key values(?). Should I use other messages to receive events?
This test works for me : (test Beep if Numpad (0-9 and +/-))
case WM_CHAR:
{
UINT nScanCode = LOBYTE(HIWORD(lParam));
if (nScanCode >= 0x47 && nScanCode <= 0x52)
Beep(6000, 10);
}
break;
Hi, @Rer
Welcome to Microsoft Q&A!
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.