I change the codes to the following:
Code:
while ( bRet = GetMessage (&msg, NULL, 0, 0))
{
bRet = TranslateMessage (&msg) ;
if (0 == bRet) {
wsprintf (szBuffer, TEXT("Error: Message: 0x%x %u, wParam: %u, lParam:0x%08x"),
msg.message, msg.message, msg.wParam, msg.lParam);
MessageBox (NULL, szBuffer, szAppName, MB_ICONERROR) ;
}
DispatchMessage (&msg) ;
}
This time the message number changes to: 0xcobd, i.e., 49341. For every click on the OK on the dialog box, the lParam beeps increasing as the following:
1st
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b208f4
---------------------------
OK
---------------------------
2nd
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b308f4
---------------------------
OK
---------------------------
3rd
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b408f4
---------------------------
OK
---------------------------
4th
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b508f4
---------------------------
OK
---------------------------
5th
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b608f4
---------------------------
OK
---------------------------
6th
---------------------------
KeyView1
---------------------------
Error: Message: 0xc0bd 49341, wParam: 17, lParam:0x00b708f4
---------------------------
OK
---------------------------
My desktop computer seems running normal if I do not run this small piece of codes or if check from TranslateMessage is removed. I do every thing as usual.
Thanks,