Must multimedia players check the message queue and invoke DispatchMessage?

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


Hi,

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
http://blogs.msdn.com/b/oldnewthing/
in another thread. That day's top post
http://blogs.msdn.com/b/oldnewthing/archive/2011/03/23/10144592.aspx
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,
http://blogs.msdn.com/b/oldnewthing/archive/2011/03/04/10136703.aspx
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.

http://blogs.msdn.com/b/oldnewthing/archive/2004/06/08/150929.aspx
"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?

Regards,
 Jörg Höhle



More information about the wine-devel mailing list