Must multimedia players check the message queue and invoke DispatchMessage?

Joerg-Cyril.Hoehle at Joerg-Cyril.Hoehle at
Fri Apr 8 06:15:47 CDT 2011


Juan Lang wrote:
>> What do you mean exactly by "message pumping"?
>It's a broad topic, but yes, basically you want to call DispatchMessage
>on some messages periodically.  See e.g. MsgWaitForMultipleHandles.

Thanks for the link to
in another thread. That day's top post
gave the answer to another question I had faced during my redesign
of the MCI MIDI player:  How does WaitFor(threadHandle) react should the
thread being waited for use CloseHandle(threadHandle) prior to exiting?

Back to message pumping,
says: "Furthermore, it's a known quantity for programs that when you
call GetMessage or PeekMessage, incoming sent messages are dispatched [...]"
Looks like I was confused.  The model of window events I have
in mind is still influenced by how things work in AmigaOS; I'm
not familiar with MS-Windows' behaviour.
Now I know many things happen before GetMessage returns.

DispatchMessage is not always needed.  Unfortunately, I don't grok
yet when DispatchMessage is required.
"Everybody who has messed with window messaging knows that GetMessage
and PeekMessage retrieve queued messages, which are dispatched to
windows via DispatchMessage."

None the clearer. If I just retrieved them (they were obviously
"dispatched" to my queue), why must I dispatch again?
I.e. what's the kind of work that the function calling GetMessage
Should/can do vs. the work to be done by whatever function DispatchMessage
eventually calls?

 Jörg Höhle

More information about the wine-devel mailing list