Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Precisely adjust window size
#5
Code:
Copy      Help
var w = wnd.find(1, "* - Google Chrome", "Chrome_WidgetWin_1");
w.MoveVisibleArea(0, 0, 1386, 560);
print.it(w.Rect);
if (w.GetRect(out var r, withoutExtendedFrame: true)) print.it(r);


static class MyExtWnd {
    /// <summary>
    ///
Moves this window as if its rectangle does not include the transparent frame.
    /// </summary>
    ///
<exception cref="AuWndException">Invalid window.</exception>
    public static void MoveVisibleArea(this wnd t, RECT r) {
        if (!t.GetRect(out var rTrue) || !t.GetRect(out var rVisible, withoutExtendedFrame: true)) throw new AuWndException(t);
        if (rVisible != rTrue) {
            r.left -= rVisible.left - rTrue.left;
            r.right += rTrue.right - rVisible.right;
            r.bottom += rTrue.bottom - rVisible.bottom;
        }

        t.MoveL(r);
    }

    
    /// <inheritdoc cref="MoveVisibleArea(wnd, RECT)"/>
    public static void MoveVisibleArea(this wnd t, int left, int top, int width, int height)
        => MoveVisibleArea(t, new(left, top, width, height));
}


Messages In This Thread
Precisely adjust window size - by Davider - 03-26-2024, 02:00 AM
RE: Precisely adjust window size - by Davider - 03-28-2024, 01:37 AM
RE: Precisely adjust window size - by Gintaras - 03-28-2024, 05:15 AM
RE: Precisely adjust window size - by Davider - 03-28-2024, 05:18 AM
RE: Precisely adjust window size - by Gintaras - 03-28-2024, 05:57 AM
RE: Precisely adjust window size - by Davider - 03-28-2024, 06:21 AM
RE: Precisely adjust window size - by Gintaras - 03-28-2024, 08:48 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)