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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top