I'm open to suggestions, but would rather one of these methods:
- Register callback so that AHK code invokes upon C# function invoke
- Named pipe server. C# sends messages to listening AHK app
Thanks, Lexikos. Very helpful! I realized I was only trying to forward events and that you showed us how to forward events from C# to AHK in the "Event Handling" post. This is working wonderfully!lexikos wrote:Is this C# dll loaded into your script, or loaded into a separate process? "IPC" usually means inter-process communication, which means communication between two or more processes.
I would suggest using an object/class.
If you need to communicate with another process, you can use ObjRegisterActive in the script and Marshal.GetActiveObject from C#.
If the dll is loaded into the script, you can just pass the object as a value to the dll. Depending on the version of C#, I suppose you can use the dynamic type and interact with the object (call methods or properties) using natural C# syntax.