Thema: Delphi Problem mit WM_COMMAND

Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: Problem mit WM_COMMAND

  Alt 31. Mär 2004, 14:21
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.
Thomas
  Mit Zitat antworten Zitat