It's often important -- using SendMessage (which directly calls the target's window 
procedure, and blocks until it returns) would make Invoke calls be processed ahead of 
other calls made by BeginInvoke, and potentially run _during_ other UI-code event 
handlers that happened to call DoEvents().

At 02:18 PM 3/1/2004, Dmitriy Zaslavskiy wrote
>I think they both use PostMessage and Control.Invoke waits on event.
>This difference is *almost* never makes a difference.
>
>Dmitriy
>
>Richard Blewett wrote:
>
>>Control.Invoke uses SendMessage internally and Control.BeginInvoke uses
>>PostMessage.
>>
>>Regards
>>
>>Richard Blewett
>>DevelopMentor
>>
>>
>>
>>>-----Original Message-----
>>>From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED-
>>>[EMAIL PROTECTED] On Behalf Of John Davis
>>>Sent: 01 March 2004 11:48
>>>To: [EMAIL PROTECTED]
>>>Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)
>>>
>>>Yes, Control.Invoke uses the message pump.  The message pump is the queue
>>>you speak of.  I'm guessing the mechanism uses a PostMessage with a
>>>WM_USER
>>>+ x.
>>>[snip]


J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to