On my WinForm, I put a button to quit Application. I put Application.Exit()
on the event Click.
When I click, WinForm is closed but the application is always running in
task Manager. What can I do ?
Thanks
Steph
Thanks in advance
Kieran
"Steph" <st...@nospamplease.com> wrote in message
news:#5lBGcrJ...@TK2MSFTNGP11.phx.gbl...
--
Greg Ewing [MVP]
http://www.claritycon.com/
"Steph" <st...@nospamplease.com> wrote in message
news:#5lBGcrJ...@TK2MSFTNGP11.phx.gbl...
1. Fire an event which all of your threads are subscribed to which tells
them to quit. When the thread receives the event it does any cleanup it has
to do and then quits.
2. On your thread references in the main thread (the ones you used to start
the threads) call .Abort(). That will raise a ThreadAbortException on the
thread which you should catch and handle appropriately.
--
Greg Ewing [MVP]
http://www.claritycon.com/
"Kieran Benton" <kie...@teejpc.homeip.net> wrote in message
news:OlbHhkrJ...@TK2MSFTNGP11.phx.gbl...
"Greg Ewing [MVP]" <gewing@_NO_SPAM_claritycon.com> wrote in message
news:ursgSsrJ...@TK2MSFTNGP11.phx.gbl...
thanks
Steph
"Greg Ewing [MVP]" <gewing@_NO_SPAM_claritycon.com> a écrit dans le message
de news: #Tz9mqrJ...@TK2MSFTNGP10.phx.gbl...
You can tell your other threads that they are background threads so they
automaticly exit when the main thread gets killed.
<thread name>.IsBackground = true;
<thread name>.Start();
Kieran
"MiHA" <marko.m...@kr.hinet.hr> wrote in message
news:ejb3YcsJ...@TK2MSFTNGP12.phx.gbl...
I think not, but I could be wrong
From MSDN:
Background threads are identical to foreground threads except for the fact
that background threads do not prevent a process from terminating. Once all
foreground threads belonging to a process have terminated, the common
language runtime ends the process by invoking Abort on any background
threads that are still alive.