/// <summary> /// Returns a value indicating whether two specified instances of WindowBounds represent the same value. /// </summary> /// <param name="value">An object to compare to this instance.</param> /// <returns><see langword="true" /> if <paramref name="value" /> is equal to this instance; otherwise, <see langword="false" />.</returns> public bool Equals(WindowBounds value) { return(value.Left == Left && value.Right == Right && value.Top == Top && value.Bottom == Bottom); }
/// <summary> /// Returns the size of the client area of the window possibly with borders. /// </summary> /// <param name="hwnd">A IntPtr representing the handle of a window.</param> /// <param name="bounds">A WindowBounds structure representing the boundaries of a window.</param> /// <returns></returns> public static bool GetWindowClientBoundsExtra(IntPtr hwnd, out WindowBounds bounds) { if (User32.GetClientRect(hwnd, out var rect)) { bounds = new WindowBounds() { Left = rect.Left, Top = rect.Top, Right = rect.Right, Bottom = rect.Bottom }; return(true); } else { bounds = default; return(false); } }
/// <summary> /// Returns a value indicating whether two specified instances of WindowBounds represent the same value. /// </summary> /// <param name="left">The first object to compare.</param> /// <param name="right">The second object to compare.</param> /// <returns> <see langword="true" /> if <paramref name="left" /> and <paramref name="right" /> are equal; otherwise, <see langword="false" />.</returns> public static bool Equals(WindowBounds left, WindowBounds right) { return(left.Equals(right)); }