What's the main difference between Application.Exit() and Application.ExitThread()?

  • Thread starter Thread starter Stan
  • Start date Start date
S

Stan

Hi

Can anyone tell me the difference between ¡yApplication.Exit()¡z and
¡yApplication.ExitThread()¡z?

I'm confused by the MSDN's explanation....

I'v try some codings but find nothing different between two of them!

Can someone give me explames?

Thanks!
 
Hi Stan,

One process can run more than one UI threads (threads that have message
pump); you can think of it like more then one main form (application)
running in the same process. Even though this is not very common it is
possible and completely OK.

Calling Application exit will cause all such UI threads to end (all
sub-application will end) and the process most likely will be removed from
the memory.

Calling Application.ExitThread will exit only the sub-application that calls
the method. The rest will stay alive.

For application with only one UI thread both methods are equivalent; that's
why probably you don't see the difference.
 
Back
Top