Exported function to create additional AutoHotkey thread in
current process from a file on disk or network.
If a thread is already executed it will terminated before new thread
starts.
Note you will need to load AutoHotkey.dll module using LoadLibrary
before you can use this function, see Example.
This function is only available in AutoHotkey.dll
OutputVar := DllCall("AutoHotkey.dll\ahktextdll", "Str", "Script", "Str", "Parameters", "Str", "Title", "CDecl UPTR")Function Example: hThread := DllCall("AutoHotkey.dll\ahktextdll", "Str", "MsgBox From Thread" ,"Str",, "Str",, "PTR")
The name of the variable in which to store the handle of newly created thread.
String containing new AutoHotkey script to be executed in AutoHotkey.dll. When omitted, following script is used:
#Persistent
#NoTrayIcon
Command line parameters that will be available in built-in variable A_Args object.
Title for the dll thread (by default filename) that will be shown in MsgBox, Gui... when no Title is given.
ahkdll behaves different when instead of MyScript.ahk an
empty string or 0 is passed:
ahktextdll, AutoHotkey.dll, AhkThread
dllpath:=A_AhkDir "\AutoHotkey.dll" DllCall("LoadLibrary","Str",dllpath) ; Load the AutoHotkey module. DllCall(dllpath "\ahktextdll","Str","MsgBox Hello World!","Str","","Str","","CDecl") ; start a new thread from file. While DllCall(dllpath "\ahkReady") Sleep 100 ; wait for the thread to exit ; Same Example like above using included AutoHotkey.dll dll:=AhkThread("MsgBox Hello World!") While dll.ahkReady() Sleep 100 ; wait for the thread to exit