ahkgetvar

Exported function to retrieve the value of a variable as string.


OutputVar := DllCall("Module\ahkgetvar", "Str", "VarName", "UInt", GetVarPointer, "CDecl Str")
Function Example: OutputVar := DllCall("AutoHotkey.dll\ahkgetvar", "Str", "MyVar", "UInt", 0 ,"CDecl Str")
                  Result := DllCall("AutoHotkey.exe\ahkgetvar", "Str", "MyVar", "UInt", 0, "CDecl Str")

Parameters

OutputVar

The name of variable in which to store the value of variable as string or variable pointer if GetvarPointer is 1 / true.

VarName

The name of the variable to get pointer or contents from.

GetVarPointer

1 / true to receive a pointer to variable, FALSE / NULL / 0 to receive content of variable, similar to GetVar.

Related

Struct, GetVar

Examples

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