Expand Minimize
6 out of 24 rated this helpful - Rate this topic

GetCurrentThreadId function

Retrieves the thread identifier of the calling thread.

Syntax


DWORD WINAPI GetCurrentThreadId(void);

Parameters

This function has no parameters.

Return value

The return value is the thread identifier of the calling thread.

Remarks

Until the thread terminates, the thread identifier uniquely identifies the thread throughout the system.

Windows Phone 8: This API is supported.

Examples

For an example, see Using Thread Local Storage.

Requirements

Minimum supported client

Windows XP [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Header

WinBase.h on Windows XP, Windows Server 2003, Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2 (include Windows.h);
Processthreadsapi.h on Windows 8 and Windows Server 2012

Library

Kernel32.lib

DLL

Kernel32.dll

See also

GetCurrentThread
OpenThread
Process and Thread Functions
Threads

 

 

Send comments about this topic to Microsoft

Build date: 11/21/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.