"ByeongSik Jeon" bsjeon@hanmail.net wrote:
- while (TRUE)
- {
if ( PeekMessage(&msg, 0, 0, 0, PM_REMOVE) )
{
struct message posted_msg;
msg_count++;
trace("posted message[%d]: %p, %04x, %08lx, %08lx\n",
msg_count, msg.hwnd, msg.message, msg.wParam, msg.lParam);
posted_msg.message = msg.message;
posted_msg.flags = posted|wparam|lparam;
posted_msg.wParam = msg.wParam;
posted_msg.lParam = msg.lParam;
add_message(&posted_msg);
TranslateMessage(&msg);
DispatchMessage(&msg);
if ( msg.message == WM_CHAR && msg.wParam == VK_RETURN )
break;
}
- }
You need to fetch all available messages, not just the selected ones. In order to do that replace 'while (TRUE)' loop by the 'while (PeekMeessage())' one, and as I pointed out earlier add_message() should be done only inside of the message proc. So the whole code above should be simplified to just
while (PeekMeessage(&msg)) { TranslateMessage(&msg); DispatchMessage(&msg); }