attach thread to main process.
Posted on 2004-09-06
How can I add a thread to the existing process. So for instance, if I do the following
// thread created from main application.
Thread alarmTimer = new Thread(new ThreadStart(alarmEventHandler));
then the alarmTimer thread is not destroyed when the main process or application is destroyed... So what I want to happen is to be able to create a separate thread but have it terminate when the main thread or process or application that it was created from terminates? So imagine you have a windows form and create a thread from it, then you would want this new thread to terminate when the form terminates...