[Lazarus] Anyone done any work with SMS (text messaging)?

Wildfire wildfire at windowsbbs.com
Fri Apr 23 18:32:07 CEST 2010


From: David W Noon [mailto:david.w.noon at ntlworld.com] 
Sent: 23 April 2010 12:20

>On Fri, 23 Apr 2010 11:09:35 +0200, Michael Schnell wrote about Re:
>[Lazarus] SendMessage Bug Work Around.:
>
>[snip]
>> I don't see why, in Windows, anybody should use SendMessage to send a

>> message top a window that is assigned to the same process. AFAIK,
this 
>> is what PostMessage (as well the VCL/LCL function as the Windows API
>> call) is provided for.
>
>The SendMessage() and PostMessage() API's have different semantics:
>
>SendMessage() places a message on a message queue and waits for a
return code from the WndProc or DlgProc that processes the message;
>
>PostMessage() places a message on a message queue and returns to
continue execution, without waiting for the message to be processed.
>
>This distinction can be very important.

Yep - PostMessage is asynchronous communication, SendMessage is
synchronous. A useful analogy would be Post as UDP, Send as TCP.
AFAIR, WM_COPYDATA is the only message that can ONLY use SendMessage,
since the pointer is only guaranteed valid during the transaction (well,
initiator dependant, of course!)

DSP




More information about the Lazarus mailing list