Event loop
Appearance
The event loop is a programming construct that waits for and dispatches events. It works by polling some internal or external "event provider", which generally blocks until an event has arrived, and then calls the relevant event handler ("dispacthes the event").
Windows Applications
The "heart" of most Win32 applications is the WinMain function, which calls GetMessage(), in a loop. GetMessage blocks until a message, or "event", is received. After some optional processing, it will call DispatchMessage(), which dispatches the message to the relevant handler, also known as WindowProc. Normally, messages that have no special WindowProc are dispatched to DefWindowProc, the default one.