how can I get an Handle to a thread from thread ID?

how can I get an Handle to a thread from thread ID?

Post by Francesc » Mon, 14 Feb 2005 11:43:33


Hi,

I 'm using CreateToolhelp32Snapshot() on PPC2003 to obtain a list of all
running thread.
It give me the threadID but when I use GetThreadTimes() I need a valid
Handle.
Using "GetThreadTimes((HANDLE)th32.th32ThreadID......) it returns the
"invalid handle"
error for all system threads but it works only for my application thread.
How can I obtain a valid handle from system thread id?

thanks,

Francesco