GetThreadId
The GetThreadId function retrieves the thread identifier of the specified thread.
DWORD GetThreadId(
HANDLE Thread
);
Parameters
Thread
[in] Handle to the thread. The handle must have the THREAD_QUERY_INFORMATION access right. For more information about access rights, see Thread Security and Access Rights.
Return Values
If the function succeeds, the return value is the thread identifier of the specified thread.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
Until a thread terminates, its thread identifier uniquely identifies it on the system.