Hey all,
I noticed in Windows 10 some oddities with PeekMessage. It's doing undocumented things.
One PeekMessage call would send MULTIPLE messages to the WndProc and then return zero (no messages according to msdn).
That's weird because:
1. It's processing more than one message in one PeekMessage call
2. It's returning zero
You can test this by creating a default Win32 app in Visual Studio, and then making the following simple changes:
/*(global var)*/ bool exitapp = false;
//.... in _tWinMain
// Main message loop:
while( !exitapp )
{
OutputDebugStringA( "CALL 1\n" );
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if( msg.message == WM_QUIT )
{
return msg.wParam;
}
char tmp[256];
wsprintfA( tmp, "PEEKED %d\n", msg.message );
OutputDebugStringA( tmp );
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
} else {
OutputDebugStringA( "none\n" );
}
OutputDebugStringA( "CALL 2\n" );
}
//...
//... in WndProc at the top
char tmp[256];
wsprintfA( tmp, "WndProc %d\n", message );
OutputDebugStringA( tmp );
//...
case WM_CLOSE:
exitapp = true;
break;
Anyone know what's going on? it messes with my engine that expects PeekMessage to process only one message.
Greetings,