Exemplo n.º 1
0
 public void SendKeys(string keys)
 {
     if (Window.GetForegroundWindow() != this.handle)
     {
         Activate();
         Sleep(200);
     }
     System.Windows.Forms.SendKeys.SendWait(keys);
 }
Exemplo n.º 2
0
 public void SendKeystrokes(string keys)
 {
     if (Window.GetForegroundWindow() != this.handle &&
         Window.GetLastActivePopup(Window.GetForegroundWindow()) != this.handle)
     {
         Activate();
         Sleep(1000);
     }
     Debug.WriteLine("Sending keys: " + keys);
     System.Windows.Forms.SendKeys.SendWait(keys);
     this.WaitForIdle(100); // wait for it to behandled by the app
 }