Exported function that executes some code temporarily from string in currently executed script.
OutputVar := ahkExec(Code)Function Example: Result := ahkExec("MsgBox `% A_Now") Result := DllCall("AutoHotkey.dll\ahkExec", "Str", "MsgBox `% A_Now", "Char") Result := DllCall("AutoHotkey.exe\ahkExec", "Str", "MsgBox `% A_Now", "Char")
The name of the variable in which to store 1 (true) if code was created and executed successfully, 0 (false) otherwise.
Code to execute temporarily in currently running script.
If code was created and executed successfully 1 (true) is returned, otherwise 0 (false).
ahkFindFunc, ahkFindLabel, ahkassign
dllpath:=A_AhkDir "\AutoHotkey.dll" DllCall("LoadLibrary","Str",dllpath) ; Load the AutoHotkey module. DllCall(dllpath "\ahktextdll","Str","","Str","","CDecl") ; start a new thread, just the function. DllCall(dllpath "\ahkExec","Str","MsgBox Hello World!","CDecl") ; add and execute code ; Same example like above but using included AutoHotkey.dll dll:=AhkThread() dll.ahkExec["MsgBox Hello World!"] ; Execute code in current thread ahkExec("MsgBox Test")