Exported function that assigns a string value to a variable in currently executed script.
OutputVar := DllCall("Module\ahkassign", "Str", "VarName", "Str", Value, "CDecl UInt")Function Example: Result := DllCall("AutoHotkey.dll\ahkassign", "Str", "Variable", "Str", "100" ,"CDecl UInt") Result := DllCall("AutoHotkey.exe\ahkassign", "Str", "Variable", "Str", "100", "CDecl UInt")
The name of the variable in which to store the result, -1 on failure and 0 on success.
Name of the variable to assign value to.
Value as String.
ahkFindFunc, ahkFindLabel, ahkgetvar
dllpath:=A_AhkDir "\AutoHotkey.dll" DllCall("LoadLibrary","Str",dllpath) ; Load the AutoHotkey module. DllCall(dllpath "\ahktextdll","Str","","Str","","CDecl") ; start a new thread from file. DllCall(dllpath "\ahkassign","Str","var","Str","value","CDecl") ; assing value to var MsgBox % DllCall(dllpath "\ahkgetvar","Str","var","UInt",0,"CDecl") ; wait for the thread to exit ; Same example like above using included AutoHotkey.dll dll:=AhkThread() dll.ahkassign("var","value") MsgBox % dll.ahkgetvar.var