ahkExec is used to run some code from text/variable temporarily.
success:=DllCall(dll_path "\ahkExec","Str","MsgBox % A_Now")
| Parameter | Description |
| success | ahkExec() returns true if script was executed and false if not |
| ("MsgBox...") | script as text(or variable containing text) that will be executed. |
None.
AutoHotkey.dll, ahkdll, ahktextdll, ahkReady, addFile, addScript, 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
SetWorkingDir % A_ScriptDir
dll:=AhkDllThread("AutoHotkey.dll") ;creates an additional AutoHotkey thread using AutoHotkey.dll
dll.ahktextdll() ;will automatically addPersistent and run "empty" script
dll.ahkExec("a=_Hello World!") ;execute some code
dll.ahkExec("StringTrimLeft,a,a,1") ;execute more code
MsgBox % dll.ahkgetvar.a ;get value of variable a