I am sending keystrokes to other running application by using SendKeys.SendWait
. But it is not working if the target application is not minimize. Is anything wrong with this method? What are the other methods to send keystrokes to running application.
Code Block that I am using:
SetForegroundWindow(handleToApplication);
System.Windows.Forms.SendKeys.SendWait(Keystroke);