Converting threaded to a handle

Hi all,

Given,

THREADENTRY32
Describes an entry from a list that enumerates the threads executing in the
system when a snapshot was taken.

typedef struct tagTHREADENTRY32{
DWORD dwSize;
DWORD cntUsage;
DWORD th32ThreadID;
DWORD th32OwnerProcessID;
LONG tpBasePri;
LONG tpDeltaPri;
DWORD dwFlags;
} THREADENTRY32;
typedef THREADENTRY32 *PTHREADENTRY32;
Members
dwSize
Specifies the length, in bytes, of the structure. Before calling the
Thread32First function, set this member to sizeof(THREADENTRY32). If you do
not initialize dwSize, Thread32First will fail.
cntUsage
Number of references to the thread. A thread exists as long as its usage
count is nonzero. As soon as its usage count becomes zero, a thread
terminates.
th32ThreadID
Identifier of the thread. This identifier is compatible with the thread
identifier returned by the CreateProcess function.
th32OwnerProcessID
Identifier of the process that created the thread. The contents of this
member can be used by Win32 API elements.
tpBasePri
Initial priority level assigned to a thread. This member can be one of the
following values:

How can I convert the th32ThreadID entry into a handle suitable for use with
SuspendThread ?

doing

SupendThread((HANDLE)te32.th32ThreadID);

te32 is a THREADENTRY32
in my code returns a last error of invalid handle.

or is there a beter way to suspend a thread.

thanks

Robert Fernando
Anite Telecoms Ltd
110 Fleet Road
Fleet
Hampshire GU51 4BL
United Kingdom
Tel: +44 (0) 1252 775200
Fax: +44 (0) 1252 775 321
Email: xxxxx@anitetelecoms.com

Anite Telecoms Limited Registered in England No. 1721900 Registered
Office: 100 Longwater Avenue, GreenPark, Reading, Berkshire RG2 6GP,
United Kingdom


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com