comctl32/tests: Prevent some test failures by moving the cursor away from the window.

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2019-10-07 11:19:40 +02:00 committed by Alexandre Julliard
parent 1f75b08127
commit 3dcff4de70
1 changed files with 7 additions and 0 deletions

View File

@ -3315,6 +3315,9 @@ static void test_change_focus(void)
HWND hwnd, parent_wnd;
WNDPROC oldproc;
MSG msg;
POINT orig_pos;
GetCursorPos(&orig_pos);
parent_wnd = CreateWindowA("ParentWnd", "", WS_OVERLAPPEDWINDOW,
0, 0, 200, 200, NULL, NULL, GetModuleHandleA(NULL), NULL);
@ -3329,6 +3332,8 @@ static void test_change_focus(void)
oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)edit_subclass_proc);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)oldproc);
SetCursorPos(400, 400);
SetFocus(parent_wnd);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
SetFocus(hwnd);
@ -3340,6 +3345,8 @@ static void test_change_focus(void)
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
ok_sequence(sequences, COMBINED_SEQ_INDEX, killfocus_combined_seq, "Kill focus", TRUE);
SetCursorPos(orig_pos.x, orig_pos.y);
DestroyWindow(hwnd);
}