The basics of Windows' messages
- From: Ney André de Mello Zunino <zunino@xxxxxxxxxxx>
- Date: Tue, 06 Jun 2006 01:38:24 -0300
Hello.
It's been more than 6 years since I took a look at Petzold's book. I would like to check just how dusty my comprehension of the basic architecture of Windows applications is. I will try to depict my current understanding by writing a series of statements. My main interest, at the moment, is in the message sending/pumping/dispatching cycle. Any correction or remark will be appreciated.
There is Windows (the OS) and there are applications. Each application (more specifically, each thread that creates a window) is given/assigned a message queue. Windows translates low-level user input (e.g. keyboard or mouse interruptions, etc.) into system messages and places them at the end of the respective application's queue.
Up to this point, the thread owning the queue would do nothing else in its available time slice other than check for messages on its queue (with, e.g., /GetMessage()/). As soon as it realizes there is a message, the thread removes it from the queue and dispatches it (calls /DispatchMessage()/). The code in /DispatchMessage()/ will find out which window procedure should be called and then invoke it. All this happens in the context of the thread which initially removed the message from the queue. As the message processing is over, the thread will resume its queue watching activity and the whole cycle starts over.
Well, I guess that's pretty much the idea I currently have of the basic workings of Windows. I sincerely wish to have that idea checked and my understanding improved by the valuable input of more experienced fellows.
Thank you very much,
--
Ney André de Mello Zunino
.
- Follow-Ups:
- Re: The basics of Windows' messages
- From: Arnaud Debaene
- Re: The basics of Windows' messages
- From: William DePalo [MVP VC++]
- Re: The basics of Windows' messages
- Prev by Date: Windriver need to resume OS work..
- Next by Date: Re: Windriver need to resume OS work..
- Previous by thread: Windriver need to resume OS work..
- Next by thread: Re: The basics of Windows' messages
- Index(es):
Relevant Pages
|