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\ahkdll", "Str", "FileName", "Str", "Parameters", "Str", "Title", "CDecl UPTR")Function Example: hThread := DllCall("AutoHotkey.dll\ahkdll", "Str", "FileName.ahk" ,"Str",, "Str",, "PTR")
The name of the variable in which to store the handle of newly created thread.
New AutoHotkey script saved on disk or network to be executed in AutoHotkey.dll. When empty, 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 "\ahkdll","Str",A_ScriptDir "\MyDllScript.ahk","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(A_ScriptDir "\MyDllScript.ahk","",true) While dll.ahkReady() Sleep 100 ; wait for the thread to exit