Re: PostThreadMessage to a thread that has a modal dialog shown
"ultranet" <ultranet@discussions.microsoft.com> wrote in message
news:EB118C9F-5136-41F5-977E-73D42551989C@microsoft.com
"William DePalo [MVP VC++]" wrote:
It is not lost. It is simply ignored. :-)
I wish it was so, but it's a non-window message, for which i don't
even try to call translate-dispatch.
You don't. Modal dialog's message pump does. Understand that when you
put up a modal dialog, it spins its own message pump independent on the
one you wrote. And it does call DispatchMessage on every message in the
queue, even the one posted by PostThreadMessage. The latter cannot be
dispatched, so it's dropped on the floor.
I recall seeing modal windows causing original event loop to be
deactivated, and starting their own event loop. But i don't recall if
that new event loop was running on the same thread or not.
It runs on the same thread that created the modal dialog in the first
place.
From this
experience i tend to think not. Does that mean there is no way for me
to queue task above while modal window is showing?
Post the message to a specific window with PostMessage, rather than
PostThreadMessage.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925