Re: Terminating User-Interface Thread
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Tue, 26 Jul 2005 08:47:43 -0500
delvsb wrote:
Good day to all.
I would like to know how to delete a thread even if the if it is still running.
Thank you very much in advance.
When you create the thread you must create it suspended, set m_bAutoDelete false, then ResumeThread.
In the main thread, signal the thread to end itself with PostThreadMessage. In the UI thread message handler, free things and call PostQuitMessage(0);
In the main thread, WaitForSingleObject on the thread handle. Then delete the thread object.
-- Scott McPhillips [VC++ MVP]
.
- Follow-Ups:
- Re: Terminating User-Interface Thread
- From: Arman Sahakyan
- Re: Terminating User-Interface Thread
- From: delvsb
- Re: Terminating User-Interface Thread
- References:
- Terminating User-Interface Thread
- From: delvsb
- Terminating User-Interface Thread
- Prev by Date: Re: How to browse for a folder
- Next by Date: Re: How to browse for a folder
- Previous by thread: Terminating User-Interface Thread
- Next by thread: Re: Terminating User-Interface Thread
- Index(es):