Re: PostMessage and C# multithread application - HOW IT REALLY WORKS



Not completely asynchronous, no. There's no good reason that I can think of
for doing that. The user interface is really a synchronous object, anyway.
If you have something that wants to happen in the background, use a thread,
but don't try to associate that with a window. Just have it do its job and
use an event or post a message to the main application, when the process is
done.

Paul T.

"Max" <spam@minimega@libero.it> wrote in message
news:e12jlSu3FHA.3260@xxxxxxxxxxxxxxxxxxxxxxx
> Hi Paul,
> thanks for your reply. You give me a reason why, so I don't need to go
> over! In fact I've tried to make the window class instance in two
> separated threads, but the result is that I get no callback to the wndproc
> function! So, isn't possible to speak in an asyncronous way with two
> windows owned by the same application (exe) with the windows message way.
>
> Thanks,
> Massimo
>
> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
> ha scritto nel messaggio news:O35m9$j3FHA.2676@xxxxxxxxxxxxxxxxxxxxxxx
>> Sure, two windows in the same application do work synchronously to each
>> other. Read the code for any C/C++ Hello, World program. There's a
>> *single* message loop that calls GetMessage() to get the next message
>> from the *application message queue* and dispatch it to the right window.
>> I suppose that you could try to use threading to create two separate
>> message loops, but I'm not sure why you'd do this and there would be
>> numerous synchronization issues to be handled.
>>
>> Paul T.
>>
>
>


.



Relevant Pages

  • Re: Advanced WinINet - Please HELP!
    ... a Windows CE question and accidentally post it to the Windows XP group), no, ... Paul T. ... >> Please don't separately post the same exact question to multiple groups. ... > planning to post the same request again after some days for that reason. ...
    (microsoft.public.windowsce.app.development)
  • Re: About Windows address space
    ... Yeah, and it's the reason why - though, trying to work out a way to ... some of the stuff over on Windows for the "time being";)... ... convinced about the "ASCII strings"... ... you can't really "re-use" the older ordinals because they ...
    (alt.lang.asm)
  • Re: A8N-SLI LAN1 not working.(solved)
    ... The reason I have always advocate reinstalling windows ... there are versioning problems with these installs. ...
    (alt.comp.periphs.mainboard.asus)
  • RE: W32Time setup for SEC compliance
    ... "Time synchronization is important in a Windows® ... standards-based authentication protocol defined by RFC 1510. ... the requirements specified by the Kerberos authentication protocol to provide ... "W32Time.dll was originally developed for Windows 2000 to support a ...
    (microsoft.public.windows.server.general)
  • Re: The case insensitive #include statement horror...
    ... like the case-insensitivity of the Windows file system, ... it's more like asking the programmer switching case sensitivity in their ... It enlarges the namespace of possible filenames... ... If there really were no reason to have upper ...
    (microsoft.public.vc.language)