ThreadObj

Create a real additional AutoHotkey thread in current process without using AutoHotkey.dll (based on NewThread).


OutputVar := ThreadObj(Script , Parameters, Title)
Function Example: Thread := ThreadObj("MsgBox Message from thread.")

Parameters

OutputVar

The name of the variable in which to store the Thread object for newly created thread.

Script

The AutoHotkey script to execute as string or variable containing a string. If you want to start a script from file simply use #Include directive.

Parameters (optional)

Command line parameters that will be available in built-in variable A_Args object.

Title (optional)

Title to use for new script.

Methods
MsgBox % thread.variable ; get a variable value
thread.variable:=Value ; set a variable value
ReturnValue := thread.Call("FunctionName", parameters...)
hread.PostCall("FunctionName", parameters...)
thread.FuncPtr("FunctionName")
thread.LabelPtr("LabelName")
thread.Exec("MsgBox Script")
thread.AddScript("MsgBox Script", Execute)
thread.ExitApp()

Related

NewThread, TlsThread

Examples

MyThread:=ThreadObj("Msgbox variable:='Thread'")
MsgBox MyThread.variable