Event Loop Article Index for
Event
Website Links For
Event
 

Information About

Event Loop




Message pumps are said to 'pump' messages from the program's message queue (assigned and usually owned by the underlying operating system) into the program for processing. In the strictest sense, an event loop is a tool of Inter-process Communication . In fact, message processing exists in many systems, and is a Kernel-level component of the Mach Operating System . The event loop is a specific implementation technique of messaging systems.


WINDOWS APPLICATIONS

The Microsoft Windows operating system requires user-interactive processes that wish to run on the operating system to construct an event loop for responding to events. In this operating system, a message is equated to an event created and imposed upon the operating system. An event can range from user interaction, network traffic, system processing, timer activity, and interprocess communication among others.

The "heart" of most Win32 Application s 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. DispatchMessage calls the window-proc of the HWND Handle of the message (Registered with the RegisterClass function).


SEE ALSO



EXTERNAL LINKS