[PATCH v3 1/2] user32/tests: Test that ShowWindow(SW_SHOWMINIMIZED) shouldn't make a window visible.
Alexandre Julliard
julliard at winehq.org
Wed Mar 16 15:20:24 CDT 2022
Zhiyi Zhang <zzhang at codeweavers.com> writes:
> @@ -7693,6 +7695,30 @@ static void test_ShowWindow(void)
>
> flush_events(TRUE);
>
> + /* Test SW_SHOWMINIMIZED shouldn't restore windows from minimized state */
> + SetWindowPos(hwndMain, 0, 100, 100, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
> + hwnd = CreateWindowA("static", "test", WS_POPUP, 100, 100, 200, 200, NULL, NULL, NULL, NULL);
> + ok(hwnd != NULL, "CreateWindowA failed, error %d.\n", GetLastError());
> + ShowWindow(hwnd, SW_SHOWMINIMIZED);
> + flush_events(TRUE);
> +
> + hdc = GetDC(0);
> + color = GetPixel(hdc, 150, 150);
> + /* Desktop pixels may take a while to update */
> + while (color != 0xffffff && timeout < 1000)
> + {
> + Sleep(100);
> + timeout += 100;
> + color = GetPixel(hdc, 150, 150);
> + }
Please try to find a better way than reading pixels from the root
window, that will never work reliably.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list