Ejemplo n.º 1
0
 public static Rectangle GetWindowRect(IntPtr hWnd)
 {
     Debug.Assert(hWnd != IntPtr.Zero);
     var rect = new RECT();
     if (GetWindowRect(hWnd, ref rect) == false)
         throw new Exception("GetWindowRect failed");
     return rect.ToRectangle();
 }