Since most Windows applications are controlled by the user interface, and the Windows user interface is controlled by extracting messages from the message queue, one common way to determine when an application is “idle” is when it has no messages in the message queue.
In a Windows application, messages always appear (user-generated and generated by the system), but in a typical application you will see frequent short periods of downtime. When the mouse moves around the window in your application, your downtimes drop to zero until the mouse stops moving, because mouse activity creates a lot of message activity.
, Windows, GetMessage, , PeekMessage. GetMessage , , . PeekMessage true, false, . PeekMessage .
PeekMessage false, "" , .
WinForms Application.Idle event
, , . .