Hi,
Probier's mal mit PostMessage anstatt SendMessage.
Zitat:
Sending the message directly (using SendMessage) means that it will be
processed before any messages currently in the message queue (for a given
thread). Indeed, SendMessage does not return (and hence no additional
messages are retrieved in the same thread) until the message is processed.
By contrast, posting the message to the message queue (using PostMessage)
means that it will be processed after the processing of the current message
is complete (together with the processing of any nested SendMessage calls)
and after any messages (of equal or higher priority) that are already in the
queue. PostMessage returns immediately after placing the message in the
queue.
Thus choosing SendMessage vs PostMessage is a way to control the order in
which messages are processed. This is sometimes essential to the logic of a
procedure.