System.MainThreadID

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

MainThreadID: TThreadID;  { ThreadID of thread that module was initialized in }

C++

extern DELPHI_PACKAGE unsigned MainThreadID;

Properties

Type Visibility Source Unit Parent
variable public
System.pas
System.hpp
System System

Description

Indicates the instance handle for the current module's main thread of execution.

Use MainThreadID to obtain the thread ID for the main execution thread (the current thread when the module was initialized).

During debugging, this ID appears in the thread status box for the main thread.

Note: On Windows, the value of MainThreadID is compatible with the thread ID required by some Win32 API calls.

See Also