Re: Relationship between Application.Exit() and AppDomain



Willy Denoyette [MVP] wrote:
"Barry Kelly" <barry.j.kelly@xxxxxxxxx> wrote in message
news:4djkv39krr67nr7f3fjttfi86581in3gpm@xxxxxxxxxx
Willy Denoyette [MVP] wrote:

"Barry Kelly" <barry.j.kelly@xxxxxxxxx> wrote:

Willy Denoyette [MVP] wrote:

Application.Exit() is a Forms API,

That is true.

Well here you are calling PostQuitMessage which doesn't really do
what it's
supposed to do

PostQuitMessage posts WM_QUIT to the current thread's message queue.
This is no different in a WPF application than in any other Windows
application. WM_QUIT causes GetMessage to return 0.


Well, It doesn't post a WM_QUIT message to the UI's thread queue when
run on Vista (both RTM and SP1), of course it does post WM_QUIT when
called in a Windows.Forms based application (or any non managed
windows app.).

Barry has this one exactly right. PostQuitMessage is a Win32 function, it
couldn't care less whether your app is WPF or WinForms or MFC or whatever.
It posts WM_QUIT and returns.

I don't know how you can get any clearer than this:

http://msdn2.microsoft.com/en-us/library/ms644945(VS.85).aspx
"The PostQuitMessage function posts a WM_QUIT message to the thread's
message queue and returns immediately; the function simply indicates to the
system that the thread is requesting to quit at some time in the future."


.