The GetCurrentThreadId function returns the thread identifier of the calling thread.
DWORD GetCurrentThreadId(VOID)
This function has no parameters.
The return value is the thread identifier of the calling thread.
Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Processes and Threads Overview, Process and Thread Functions, GetCurrentThread