My target is to send keyboard events to external application.
From my application, I'm launching a C# console application that bring the target application to the front and uses SendKeys.SendWait to send keyboards events. I ran into a rate case where the command doesn't have any affect.
When debugging it, it works but when running it not in debug it fails. I think it as something to do with the fact that when debugging my application is the active application.
You'll need to do a little work, and it changes depending on the version of Windows. There's an MSDN page that has a good explanation and an example:
http://msdn.microsoft.com/en-us/library/ms171548.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With