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.