ahktextdll


ahktextdll is used to launch a script in a separate thread using AutoHotkey.dll from text/variable. ( Available in AutoHotkey[Mini].dll only, not in AutoHotkey_H.exe)

hThread:=DllCall(dll_path "\ahktextdll","Str","MsgBox % dll_path`nMsgBox % A_Now`nReturn","Str",options,"Str",parameters,"Cdecl UPTR")

Parameters

Parameter

Description

hThread

ahktextdll() returns a thread handle.

("MsgBox...")

This parameter must be an AutoHotkey script as text or variable containing a script as text.

(options)

Within the script you can access this parameter via build in variable A_ScriptOptions.

(parameters)

Parameters passed to dll. Similar to Run myscript.exe "parameters"

Return Value

Cdecl UPTR - ahkdll returns a thread handle, using this handle you can use functions like DllCall("SuspendThread/ResumeThread/GetExitCode",...)... for your thread.

Remarks

Don't forget to load AutoHotkey.dll via DllCall("LoadLibrary"...), otherwise it will be automatically Freed by AutoHotkey.exe after DllCall finished.

Related

AutoHotkey.dll, ahkdll, ahkReady, addFile, addScript, ahkExec, ahkLabel, ahkFunction, ahkPostFunction, ahkassign, ahkgetvar, ahkTerminate, ahkReload, ahkFindFunc, ahkFindLabel, ahkPause, ahkExecuteLine, Alias, cacheEnable, FindFunc, FindLabel, getTokenValue, getVar, Static, AutoHotkeyMini, DynaCall, CriticalSection, CriticalObject, MemoryLoadLibrary, ResourceLoadLibrary, MemoryGetProcAddress, MemoryFreeLibrary, Other Changes

Example

AhkDll:=AhkDllObject("AutoHotkey.dll")
AhkDll.ahktextdll("MsgBox MsgBox from AutoHotkey.dll")
MsgBox end main thread