Plum, Jason wrote:
WaitMessage... Ah, I was wondering what that was for.... The question I
of course must supply is ... (dun dun dun) ... to attach said thread's
queue to said function?

Each windows gui thread has exactly one message queue. It is created by the OS when the first win32 api call is made in that thread. The OS then devlivers messages from other threads and from the window manager that are destined for any window created by that thread to the thread's message queue.

The the application (Win32::GUI::Dialog() or one of it's alternatives to be precise) takes over, pulling messages one at a time and dispatching them to the actual window that they need to be delivered to.

So WaitMessage() simply blocks the thread it is called from (and yields processor resource to other threads/processes) while there are no messages in the message queue of the calling thread.

For more detail MSDN is the place to start - look up WaitMessage and there are some links from the bottom of the page to more general windows message processing descriptions.

Rob.

Reply via email to