[fpc-pascal] PostMessage vs. QueueAsyncCall

Xiangrong Fang xrfang at gmail.com
Fri Sep 19 11:20:27 CEST 2014


Hi,

In a previous email asking about PostMessage, Michael suggested I used
QueueAsyncCall instead, because although it's OK to use PostMessage, but it
is considered a Windows Legacy, or only for Delphi compatibility.

However, in actual use, I feel that PostMessage does a better job for code
separation. Because when use PostMessage, GUI (or main thread) related code
are written in the main form, and the thread will not need to use the Forms
unit.

My question is, why cannot Lazarus just use PostMessage, but invent the
QueueAsyncCall() method?  What is the rationale, or, why PostMessage is
considered windows-ish (read: not fit into LCL very well?), apart from the
fact that it is a Windows API?

Thanks,
Xiangrong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140919/aeef1d4c/attachment.html>


More information about the fpc-pascal mailing list