diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 8477645fad5..37b1a4aef6d 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -3466,7 +3466,8 @@ static void test_Input_mouse(void) 100, 100, 100, 100, 0, NULL, NULL, NULL); ok(button_win != 0, "CreateWindow failed\n"); - pt.x = pt.y = 150; + pt.x = pt.y = 50; + ClientToScreen(button_win, &pt); hwnd = WindowFromPoint(pt); if (hwnd != button_win) { @@ -3476,7 +3477,7 @@ static void test_Input_mouse(void) } /* simple button click test */ - simulate_click(TRUE, 150, 150); + simulate_click(TRUE, pt.x, pt.y); got_button_down = got_button_up = FALSE; while (wait_for_message(&msg)) { @@ -3501,7 +3502,7 @@ static void test_Input_mouse(void) ok(static_win != 0, "CreateWindow failed\n"); def_static_proc = (void*)SetWindowLongPtrA(static_win, GWLP_WNDPROC, (LONG_PTR)static_hook_proc); - simulate_click(FALSE, 150, 150); + simulate_click(FALSE, pt.x, pt.y); hittest_no = 0; got_button_down = got_button_up = FALSE; while (wait_for_message(&msg)) @@ -3531,7 +3532,9 @@ static void test_Input_mouse(void) ok(static_win != 0, "CreateWindow failed\n"); def_static_proc = (void*)SetWindowLongPtrA(static_win, GWLP_WNDPROC, (LONG_PTR)static_hook_proc); - simulate_click(TRUE, 150, 150); + pt.x = pt.y = 50; + ClientToScreen(static_win, &pt); + simulate_click(TRUE, pt.x, pt.y); hittest_no = 0; got_button_down = got_button_up = FALSE; while (wait_for_message(&msg)) @@ -3565,7 +3568,9 @@ static void test_Input_mouse(void) hittest_no = 0; got_button_down = got_button_up = FALSE; WaitForSingleObject(thread_data.start_event, INFINITE); - simulate_click(FALSE, 150, 150); + pt.x = pt.y = 50; + ClientToScreen(thread_data.win, &pt); + simulate_click(FALSE, pt.x, pt.y); while (wait_for_message(&msg)) { DispatchMessageA(&msg); @@ -3593,7 +3598,9 @@ static void test_Input_mouse(void) "AttachThreadInput failed\n"); while (wait_for_message(&msg)) DispatchMessageA(&msg); SetWindowPos(thread_data.win, button_win, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); - simulate_click(TRUE, 150, 150); + pt.x = pt.y = 50; + ClientToScreen(thread_data.win, &pt); + simulate_click(TRUE, pt.x, pt.y); while (wait_for_message(&msg)) { DispatchMessageA(&msg); @@ -3615,7 +3622,9 @@ static void test_Input_mouse(void) ok(hwnd != 0, "CreateWindow failed\n"); SetCapture(button_win); got_button_down = got_button_up = FALSE; - simulate_click(FALSE, 50, 50); + pt.x = pt.y = 50; + ClientToScreen(hwnd, &pt); + simulate_click(FALSE, pt.x, pt.y); while (wait_for_message(&msg)) { DispatchMessageA(&msg); @@ -3641,7 +3650,9 @@ static void test_Input_mouse(void) 0, 0, 100, 100, button_win, NULL, NULL, NULL); ok(hwnd != 0, "CreateWindow failed\n"); got_button_down = got_button_up = FALSE; - simulate_click(TRUE, 150, 150); + pt.x = pt.y = 50; + ClientToScreen(hwnd, &pt); + simulate_click(TRUE, pt.x, pt.y); while (wait_for_message(&msg)) { DispatchMessageA(&msg); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 6336664199c..8bed81b6faf 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -17470,7 +17470,8 @@ static void test_keyflags(void) MSG msg; test_window = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, - 100, 100, 200, 200, 0, 0, 0, NULL); + 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), + 0, 0, 0, NULL); flush_events(); flush_sequence(); @@ -17705,8 +17706,11 @@ static void test_hotkey(void) "unexpected error %ld\n", GetLastError()); test_window = CreateWindowExA(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE, - 100, 100, 200, 200, 0, 0, 0, NULL); + 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), + 0, 0, 0, NULL); + SetForegroundWindow(test_window); + flush_events(); flush_sequence(); SetLastError(0xdeadbeef);