diff options
Diffstat (limited to 'modules/desktop_capture/win/test_support/test_window.cc')
-rw-r--r-- | modules/desktop_capture/win/test_support/test_window.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/desktop_capture/win/test_support/test_window.cc b/modules/desktop_capture/win/test_support/test_window.cc index bcbadecfaf..c07ff74aa5 100644 --- a/modules/desktop_capture/win/test_support/test_window.cc +++ b/modules/desktop_capture/win/test_support/test_window.cc @@ -75,8 +75,16 @@ WindowInfo CreateTestWindow(const WCHAR* window_title, } void ResizeTestWindow(const HWND hwnd, const int width, const int height) { + // SWP_NOMOVE results in the x and y params being ignored. ::SetWindowPos(hwnd, HWND_TOP, /*x-coord=*/0, /*y-coord=*/0, width, height, - SWP_SHOWWINDOW); + SWP_SHOWWINDOW | SWP_NOMOVE); + ::UpdateWindow(hwnd); +} + +void MoveTestWindow(const HWND hwnd, const int x, const int y) { + // SWP_NOSIZE results in the width and height params being ignored. + ::SetWindowPos(hwnd, HWND_TOP, x, y, /*width=*/0, /*height=*/0, + SWP_SHOWWINDOW | SWP_NOSIZE); ::UpdateWindow(hwnd); } |