private static extern bool GetWindowRect(IntPtr hWnd, ref APIRectangle rect);
/// <summary> /// 获取窗体的区域 /// </summary> /// <param name="handle">窗体句柄</param> /// <returns></returns> public static Rectangle GetWindowRect(IntPtr handle) { APIRectangle r = new APIRectangle(); GetWindowRect(handle, ref r); return new Rectangle(r.Left, r.Top, r.Width, r.Height); }