[Lazarus] SendMessage Bug Work Around.
Michael Schnell
mschnell at lumino.de
Thu Apr 22 17:41:37 CEST 2010
but LCL
> SendMessage is not Windows SendMessage. Lazarus LCL SendMessage is
> designed to work with Lazarus LCL, as it must be cross platform.
>
I do know that as well with Delphi as with Lazarus/Windows and with
Lazarus/GTK PostMessage is documented, designed and working equal: send
a set of three 32 (64) bit values to the main thread of the process the
application the thread calling PostMessage is a part of (while the
Target-"Handle" needs to be taken from the (main) form's handle
property). The received message is propagated via "Dispatch" in the
forms "Dispatch" procedure.
But I am astonished to find that SendMessage in fact leads to some code
in the gtk interface unit. SendMessage in Windows in fact is documented
to send a "Message" (three 32 (64) bit values" to a different process.
Same does not need to be done in Lazarus (or Delphi). So this is nothing
more than an encapsulation of a Windows OS API. I don't see how this
(sending such a Message to a process that is not done in Lazarus) could
be implemented in Linux in a useful way. Of course using a pipe or
something like that could make this happen for two processes done with
Lazarus, but AFAIK, there currently is no implementation for this.
So what does SendMessage do in GTK and what is the difference between
PostMessage and SendMessage ? (AFAIK, in Delphi and Lazarus-Windows
there is none (but performance), if the target handle is associated to
the same process.) The documentation and the wiki does not seem to
provide this information.
-Michael
More information about the Lazarus
mailing list