Message Flow

Windows generates messages for every hardware event, such as when the user presses a key on a keyboard or moves a mouse. It passes these messages to the appropriate thread message queue. Each thread in the system processes the messages in its own message queue. If a message is destined for a specific thread, the message is placed in that thread's message queue. Some messages are systemwide or are destined for multiple threads. These messages are placed in the queues of the appropriate threads. Figure 5.1 shows a simple diagram of how a message is processed by multiple threads.

Figure 5.1. Windows message flow diagram.

A message is ...

Get Microsoft Windows 2000 API SuperBible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.