Solved

Windows thread handle

Posted on 2002-04-21
1
231 Views
Last Modified: 2010-04-04
Is it OK to create a thread. And while the thread runs call closehandle(hThread), will everything then be cleaned up when the thread procedure exits?

like this

var
    hThread: THandle;
    Dummy: Cardinal;
begin
    hThread := CreateThread(nil, 0, @ThreadProc, nil, 0, Dummy);
    if hThread <> 0 then
    begin
        SetThreadPriority(hThread, THREAD_PRIORITY_BELOW_NORMAL);
        CloseHandle(hThread);
    end;
0
Comment
Question by:koger
1 Comment
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 6957778
No problem, doin' it every day.

Regards, Madshi.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now