[Lazarus] LCL messaging system SendMessage and Multi-Threads
Michael Schnell
mschnell at lumino.de
Mon May 10 10:46:04 CEST 2010
On 05/08/2010 04:08 AM, Hans-Peter Diettrich wrote:
>
> Right, Windows manages messages...
Only the ones with message number lower that the "user" limit. Thus to
do portable applications, only greater message numbers are allowed to be
used with PostMessage. If a some GUI stuff needs to be triggered by a
message in a portable way, you would not send the Windows-Message number
and with that directly trigger the GUI system action by the thread
(bypassing the LCL that is __supposed__ to manage the GUI actions), but
send a message to the main thread and there (in the message handling
procedure) do an LCL call that does the cation in the LCL-compatible way.
IMHO, even when doing just a Windows project, it's not recommended to
bypass the LCL and send a Windows-message (lower than "user") via
PorstMessage (or SendMessage) directly to the Windows GUI-System, as the
LCL's internal state might not reflect that Windows GUI System state,
and might do erroneous stuff later.
-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20100510/777d8d47/attachment-0004.html>
More information about the Lazarus
mailing list