I'm look for some tips on how to get AutoHotkey.dll and/or AutoHotkey.Interop to work.
I've been able get the following code to run in LinqPad by adding a reference to AutoHotkey.Interop:
Code: Select all
Dim Engine As New AutoHotkey.Interop.AutoHotkeyEngine
engine.ExecRaw("#InstallKeybdHook")
engine.ExecRaw("!^g::send Hello World")
engine.ExecRaw("msgbox, Move me out of the way`nI block threads")
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
;~ SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;~ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#Include CLR_H.ahk
vb =
(
Imports System.IO
Imports System.Runtime
Imports System.Windows.Forms
Imports AutoHotkey.Interop
Class Foo
Sub Test()
Dim Engine As New AutoHotkey.Interop.AutoHotkeyEngine
engine.ExecRaw("#InstallKeybdHook")
engine.ExecRaw("!^g::send Hello World")
engine.ExecRaw("msgbox, Move me out of the way`nI block threads")
End Class
)
asm := CLR_CompileVB(vb, "System.dll | System.IO.dll | System.Windows.Forms.dll")
obj := CLR_CreateObject(asm, "Foo")
obj.Test()
Spoiler
All help greatly appreciated!Regards,
burque505