Returns an operating-system-dependent identifier associated with the thread.
HRESULT GetSystemThreadId( DWORD* dwThreadId );
- dwThreadId
 [out] An operating-system-dependent identifier associated with the thread.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Value  | Description  | 
|---|---|
S_OK  | The method succeeded.  | 
The value of dwThreadId does not need to be unique across machines.