问题
I'm looking to essentially write code similar to what I can do with AutoHotKey, only in .NET and C#, because it's a much more robust environment. I didn't know if there was a wrapper library available for these sorts of hooks or not.
Does anyone know of a library that does this for .NET?
回答1:
This actually looks pretty promising, I haven't tested it yet, but it's at least a good starting point. Not too bad considering it's on CodeProject. lol.
回答2:
For sending keys you can use System.Windows.Forms.SendKeys.
For mouse and other input you have to wrap the SendMessage API.
来源:https://stackoverflow.com/questions/4809001/is-there-a-net-library-for-sending-keystrokes-mouse-clicks-mouse-movements-an