From: David W Noon [mailto:[email protected]] 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 -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
