Closed jaywick closed 9 years ago
Autohotkey will Block by giving the code you want to run instead of setting up a hotkey.
ahk.ExecRaw("MsgBox, This message will block until you press OK.");
However, from your example code it looks like you want to use a callback. There currently isn't a way for this library to provide callbacks from AHK back into .NET.
I've researched this for a while and found one solution, Which would be setting up IPC between the .net and AHK via named pipes. It doesn't look pretty. But it would work by having the C# program create a named pipe server and then have autohotkey connect as a client and send messages to the named pipe.
Here is a link that might help you get started. http://www.autohotkey.com/board/topic/103403-ipc-using-named-pipes/
Hope this helps! ~Andrew
You're right @amazing-andrew , it appears IPC is the only way. I wasn't aware Autohotkey would play well with named pipes! Thanks for the link :+1:
Is there way to wait for the script to exit before returning control back to C#. Either via callback or blocking call?
For example