Re: The basics of Windows' messages



"Ney André de Mello Zunino" <zunino@xxxxxxxxxxx> wrote in message
news:u8M4dKSiGHA.1600@xxxxxxxxxxxxxxxxxxxxxxx
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()/).

That's close to the truth but not required. Windows applications must pump
messages or they appear "hung" or "stuck" to the user. But some applications
when there are no messages pending may do some other processing that does
not take much time between messages.

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.

Yes. That's pretty much it as far as messages that are posted go. Messages
may be sent as well. In the case of messages sent _across_ processes, the
sender is blocked until the receiver processes the message. When the
receiver next calls GetMessage() or PeekMessage(), Windows will note that
there is a sent message pending, and it will route it to the traget window
before fetching the next message from the queue.

Regards,
Will


.



Relevant Pages

  • RE: Problems Printing After XP Upgrade from 98SE
    ... following steps to clean the printer subsystem completely on the ... Windows NT Fax Monitor ... AppleTalk Printing Devices ... | workstation, but if I do that, I'll have to create the queue and re-share ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: as400 print que on windows 2003
    ... If the firewall doesn't fix your problem, try using RPM Select from ... The culprit may be the Windows Firewall. ... configuring TCP print services on another device (you can use Windows ... and the printer queue name exsists with no special characters. ...
    (comp.sys.ibm.as400.misc)
  • Re: Delaying events for fixed amounts of time.
    ... amount of time after the *FIRST* event with a given key arrives. ... I have anything Windows has to offer. ... Pause for, say, 250ms each time through the loop ... Have a queue of keys, each time a new key arrives, add it to the end ...
    (comp.programming.threads)
  • RE: Problems Printing After XP Upgrade from 98SE
    ... Can you print any local print jobs correctly in the system which ... Does the issue occur on only one Windows XP client or all other Windows ... | all of the jobs from the queue and print a test page from XP, ... |> Use the net.exe command to establish a persistent connection. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: How does PeekMessage really work?
    ... It's a good idea to analyze messages in WndProc or have a hook, ... message when it's already retrieved from the send-message queue because if I ... the right place to do this is inside the WinProc itself. ... Windows must somehow know of the origin, ...
    (microsoft.public.vc.mfc)