title: Get A Window's Bounds By Its Handle
body: <p>I am trying to get the height and the width of the current active window.</p>
  
  <pre><code>[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  public static extern IntPtr GetForegroundWindow();
  
  [DllImport("user32.dll")]
  private static extern bool GetWindowRect(IntPtr hWnd, Rectangle rect);
  
  Rectangle bonds = new Rectangle();
  GetWindowRect(handle, bonds);
  Bitmap bmp = new Bitmap(bonds.Width, bonds.Height);
  </code></pre>
  
  <p>This code doesn't work because I need to use <code>RECT</code> and I don't know how.</p>