Just post a message to an invisible window (for example, a message-only
window). This way it won't be lost. A thread message requires that the
message pump be aware of it, by definition.
On 2 Okt., 00:02, "Doug Harrison [MVP]" <d...@mvps.org> wrote:
I meant it would be better than trying to roll one's own message queue to
work around the PostThreadMessage issues. In order for PTM to work right,
all message loops have to account for it, which could be a problem down
the
road if you add a secondary message loop for some reason.
?
there are only two acceptable scenarios:
1: Message IS delivered to the treads message queue and WILL appear in
the threads own message loop
2: Message cant be delivered and the posting-Fn return an error.
I post a mesage to a thread and expect the thread to receive it. thats
it. If the thread doesnt process it right now because it displayes a
message box, draws a button, hacks the White House or has fun leaking
memory, i expect the message to stay in the queue. if ANOTHER thread
is currently doing $whatever i expect the message queue of my thread
undisturbed. As PostThreadMessage() doesnt fulfill those simple
expectations, i assume it poorly implemented and do it myself.