Code: Select all
hModule := DllCall("LoadLibrary", "Str", "AutoHotkey.dll")
DllCall("AutoHotkey.dll\ahktextdll", "Str", "", "Str", "")
math := "5 + 5"
DllCall("AutoHotkey.dll\ahkExec", "Str", "MsgBox `% result := " math) ; this shows '10' from ahkExec as expected
result := DllCall("AutoHotkey\ahkgetvar", "Str", "result", "UInt", 0)
MsgBox % result ; returns an address, presumably
MsgBox % *result ; returns 49 (???)
DllCall("FreeLibrary", "Ptr", hModule)