Returns the thread identifier of the calling thread
#include <WinAPIProc.au3>
_WinAPI_GetCurrentThreadId ( )
Search GetCurrentThreadId in MSDN Library.
#include <MsgBoxConstants.au3>
#include <WinAPIProc.au3>
MsgBox($MB_SYSTEMMODAL, "ID", "Get Current Thread: " & _WinAPI_GetCurrentThreadId())