GetCurrentThreadId 函式 (processthreadsapi.h)

擷取呼叫線程的線程標識碼。

Syntax

DWORD GetCurrentThreadId();

傳回值

傳回值是呼叫線程的線程標識碼。

備註

在線程終止之前,線程標識碼會在整個系統中唯一識別線程。

範例

如需範例,請參閱 使用線程本機記憶體

規格需求

需求
最低支援的用戶端 Windows XP [傳統型應用程式 |UWP 應用程式]
最低支援的伺服器 Windows Server 2003 [傳統型應用程式 |UWP 應用程式]
目標平台 Windows
標頭 processthreadsapi.h (Windows Server 2003、Windows Vista、Windows 7、Windows Server 2008 Windows Server 2008 R2)
程式庫 Kernel32.lib
DLL Kernel32.dll

另請參閱

GetCurrentThread

OpenThread

處理序和執行緒函式

執行緒

VBS 記憶體保護區中可用的 Vertdll API