6 ms·
As someone who has worked with Win32 for a long time, I think the problem is quite simple; in the message loop body someone put something like if(dataAvail
by userbinator 13y ago
As someone who has worked with Win32 for a long time, I think the problem is quite simple; in the message loop body someone put something like
if(dataAvailable())
fetchData();
and assumed regular window messages to drive execution of this process. If you don't move the mouse or do anything else with the window, no messages are sent to it (unless a timer or something else does) and the message loop just waits for the next message, so that code doesn't get run. If you move the mouse around in the window a constant stream of WM_MOUSEMOVE will drive the loop. Polling really shouldn't be done in the main message loop; one way to fix this is to move to a completely event-driven system where dataAvailable() sends a message that causes the main loop to run fetchData().