ConsoleApplication.CurrentThread

From Xojo Documentation

Read-Only Property (As Thread )
ThreadValue = aConsoleApplication.CurrentThread

Supported for all project types and targets.

Obtains the currently running Thread.

Notes

If the current Thread is the main thread (the thread that it used internally to run the application), CurrentThread returns Nil.

Sample Code

This code gets the ID of the currently running thread, which should be the main thread.

Dim t As Thread = App.CurrentThread
If t <> Nil Then
MsgBox("The Thread ID is " + Str( t.ThreadID ))
Else
MsgBox("The thread is the main thread")
End If