title: Sending Keystroke
body: <p>Im using <code>SendKey</code> and those functions to send keystrokes to a window located by its Window Name     </p>
  
  <pre><code>[DllImport("user32.dll")]
  public static extern int FindWindow(
      string lpClassName, // class name 
      string lpWindowName // window name 
      );
  
  [DllImport("user32.dll")]
  public static extern int SetForegroundWindow(
      int hWnd // handle to window
      );
  </code></pre>
  
  <p>Is there another way to send keystroke to a window without putting it in the foreground ?</p>
  
  <p>Im switching between many windows and <code>SendKey</code> is making some errors that I can't control, I can't use <code>SendWait</code> no either putting some thread delays, it has to be the fastest possible ,</p>
  
  <p>Im just looking how it can be done.</p>