I was able to get one of the AutoHotkey.Interop examples to compile and execute in MS Visual Studio (Visual C# Console App project) using assemblies: Microsoft.CSharp.dll;System.dll;System.Core.dll;System.Data.dll;System.Data.DataSetExtensions.dll;System.Net.Http.dll;System.Xml.dll;System.Xml.Linq.dll;AutoHotkey.Interop.dll ...and the following code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class VAInline
{
static void Main()
{
//grab a copy of the AutoHotkey singleton instance
var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();
//execute any raw ahk code
ahk.ExecRaw("MsgBox, Hello World!");
}
}
Applying this same code and referenced assembly set to an inline C# function in VA unfortunately does not work. Note that the auther of the Interop.dll uses "var ahk = new AutoHotkey.Interop.AutoHotkeyEngine();" instead of "var ahk = AutoHotkeyEngine.Instance;" in his sample code. Yes I changed the "Main" to "main" and I added the AutoHotkey.Interop.dll to my v4 Framework folder, and the code DOES compile. But when I run the code I get the following error:
Exception has been thrown by the target of an invocation. Could not load file or assembly 'AutoHotkey.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Anyone have any suggestions?
EDIT: attached AutoHotkey.Interop.dll used for testing