From: "Haidong Yu" Subject: [PATCH v2 1/2] user32/tests: Add tests for showing and minimizing owned windows. Message-Id: <1ddc6625.6a89.17467badb91.Coremail.yhd986@163.com> Date: Mon, 7 Sep 2020 16:42:13 +0800 (CST) From 8e8038ed442cb0e38a2c90e9d1c797fe0afb98c6 Mon Sep 17 00:00:00 2001 From: Haidong Yu Date: Mon, 7 Sep 2020 16:33:50 +0800 Subject: [PATCH v2 1/2] user32/tests: Add tests for showing and minimizing owned windows. Signed-off-by: Haidong Yu --- dlls/user32/tests/win.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 843da8900f..b5473e8d06 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -7082,6 +7082,34 @@ static void test_ShowWindow_owned(HWND hwndMain) DestroyWindow(hwnd2); DestroyWindow(hwnd); + + hwnd = CreateWindowExA(0, "MainWindowClass", "Main window", + WS_POPUP | WS_VISIBLE, + 100, 100, 200, 200, + 0, 0, GetModuleHandleA(NULL), NULL); + ok(!!hwnd, "failed to create window, error %u\n", GetLastError()); + hwnd2 = CreateWindowExA(WS_EX_NOACTIVATE, "MainWindowClass", "owned", + WS_POPUP | WS_VISIBLE, orig.left, orig.top, + orig.right - orig.left, orig.bottom - orig.top, + hwnd, 0, 0, NULL); + ok(!!hwnd2, "failed to create window, error %u\n", GetLastError()); + + ShowWindow(hwnd, SW_MINIMIZE); + flush_events(TRUE); + todo_wine + ok(!(GetWindowLongA(hwnd2, GWL_STYLE) & WS_VISIBLE), "window should not be visible\n"); + + ShowWindow(hwnd, SW_SHOWNORMAL); + flush_events(TRUE); + SendMessageA(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, NULL); + flush_events(TRUE); + ShowWindow(hwnd, SW_SHOWNOACTIVATE); + flush_events(TRUE); + todo_wine + ok(GetWindowLongA(hwnd2, GWL_STYLE) & WS_VISIBLE, "window should be visible\n"); + + DestroyWindow(hwnd2); + DestroyWindow(hwnd); } static void test_ShowWindow_child(HWND hwndMain) -- 2.20.1