AutoHotkey COM Interface
Available Interfaces
Module AutoHotkey v1 |
Interface |
GUID |
Last registered (Unicode/ANSI/X64) |
AutoHotkey.Script |
{C00BCC8C-5A04-4392-870F-20AAE1B926B2} |
Unicode 32-bit |
AutoHotkey.UNICODE |
{C58DCD96-1D6F-4F85-B555-02B7F21F5CAF} |
ANSI 32-bit |
AutoHotkey.ANSI |
{974318D9-A5B2-4FE5-8AC4-33A0C9EBB8B5} |
Unicode 64-bit |
AutoHotkey.X64 |
{38D00012-DC83-4E17-9BAD-D9DD97902580} |
Module AutoHotkey v2 |
Interface |
GUID |
Last registered (Unicode/X64) |
AutoHotkey2.Script |
{FEEEC4BA-04AF-45F0-B385-7290C65CFB9B} |
Unicode win32 |
AutoHotkey2.UNICODE |
{EC81EBBA-6CEE-4363-AB77-C0E57046AA89} |
Unicode x64 |
AutoHotkey2.X64 |
{F1D0DE03-30FD-4326-B33F-989BBFAA5FFA} |
Examples
Visual Basic example.
Sub atest()
Dim AhkCom As Object
Set AhkCom = CreateObject("AutoHotkey.Script")
AhkCom.ahktextdll("MsgBox Hello World!" & Chr(13) & "ExitApp")
End Sub
AutoHotkey example.
AhkCom := ComObjCreate("AutoHotkey.Script")
AhkCom.ahktextdll("MsgBox Hello World!`nExitApp")
While AhkCom.ahkReady()
Sleep, 100
MsgBox Exiting now
ComObjDll example
hModule:=DllCall("LoadLibrary","Str",A_AhkDir "\AutoHotkey.dll")
ahk:=ComObjDll(hModule,"{FEEEC4BA-04AF-45F0-B385-7290C65CFB9B}") ; CLSID for Version 2.0
hModule:=MemoryLoadLibrary(A_AhkDir "\AutoHotkey.dll")
ahk:=ComObjMemDll(hModule,"{FEEEC4BA-04AF-45F0-B385-7290C65CFB9B}") ; CLSID for Version 2.0