Determine if a specific thread is running or not??

Hi folks i was hoping you guys could help me out.
I need to know programatically if a thread is running or not.
I am using begin thread function (I know people say that i should use beginthread (extended) instead)...but anyways I need to know if this is possible

General description of how i create threads

void Copy_Transfer(void *p)
{
//sample procedure how i create threads...pretty basic
}

void main()
{
HANDLE Copy_Thread;
Copy_Thread= (HANDLE) _beginthread(Copy_Transfer,0,0);
}

Now i need to know if Copy_Transfer thread is running or not...
I am willing to try other methods also but then I would appreciate if you could also give a sample example similar to mine on how thread could be created using
those methods (_beginthread_ex , createthread etc)
I would really appreciate the help thank you
I don't think so. Why do you need to do this? To wait for a thread to finish? If that's the case, you can just WaitForSingleObject().
Actually 2 or 3 instances of a thread may be running simultaneously. however I need to run another routine which should only start only if these threads are not running. Its pretty sad cause i also program in vb.net and there is a function .alive which basically returns a bool value of the status of the thread.
You mean like a callback?
well not really a call back to a thread means passing data to a thread (i.e signal , etc) . Here i merely trying to determine if a thread is currently on. I.e (if the thread is running or not)
if i have a handle to a thread can i determine if that handle is being used or not ?? such as in the top mst post??
Got the answer I could use GetExitCodeThread
thanks for the suggestions folks...
Topic archived. No new replies allowed.