public static extern bool GetWindowRect(IntPtr hWnd, out RECT WindowRECT);
public static Rectangle GetWindowRectangle(IntPtr hWnd) { RECT rect = new RECT(); GetWindowRect(hWnd, out rect); return new Rectangle(rect.Left, rect.Top, rect.Right - rect.Left, rect.Bottom - rect.Top); }
public static extern bool ClipCursor(ref RECT lpRect);