From 91b09e0c5bbd17f0633331e40be4f83b47cfc982 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 13 Nov 2017 18:13:46 +0800 Subject: [PATCH] user32/tests: Separate WS_EX_TOPMOST tests from SetWindowPos ones. Signed-off-by: Dmitry Timoshkov Signed-off-by: Alexandre Julliard --- dlls/user32/tests/win.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 992fbf49791..fdfdf9215ac 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -2573,17 +2573,6 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) orig_win_rc.right, orig_win_rc.bottom, 0); ok(ret, "Got %d\n", ret); - ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); - ret = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); - ok(ret, "Got %d\n", ret); - ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); - ret = SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); - ok(ret, "Got %d\n", ret); - ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); - ret = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); - ok(ret, "Got %d\n", ret); - ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); - hwnd_desktop = GetDesktopWindow(); ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%d).\n", GetLastError()); hwnd_child = create_tool_window(WS_VISIBLE|WS_CHILD, hwnd); @@ -9867,6 +9856,22 @@ static void test_desktop( void ) } } +static void test_topmost(HWND hwnd) +{ + BOOL ret; + + ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); + ret = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); + ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + ret = SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); + ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + ret = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + ok(ret, "Got %d\n", ret); + ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); +} + START_TEST(win) { char **argv; @@ -9944,6 +9949,7 @@ START_TEST(win) our_pid = GetWindowThreadProcessId(hwndMain, NULL); /* Add the tests below this line */ + test_topmost(hwndMain); test_child_window_from_point(); test_window_from_point(argv[0]); test_thick_child_size(hwndMain);