user32/tests: Restore the mouse cursor to its original position.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2017-02-07 10:26:23 +00:00 committed by Alexandre Julliard
parent 8ac7c1faf2
commit 01112061c2
1 changed files with 4 additions and 0 deletions

View File

@ -2463,6 +2463,7 @@ static void test_menu_input(void) {
HANDLE hThread, hWnd; HANDLE hThread, hWnd;
DWORD tid; DWORD tid;
ATOM aclass; ATOM aclass;
POINT orig_pos;
if (!pSendInput) if (!pSendInput)
{ {
@ -2507,6 +2508,8 @@ static void test_menu_input(void) {
ShowWindow(hWnd, SW_SHOW); ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd); UpdateWindow(hWnd);
GetCursorPos(&orig_pos);
hThread = CreateThread(NULL, 0, test_menu_input_thread, hWnd, 0, &tid); hThread = CreateThread(NULL, 0, test_menu_input_thread, hWnd, 0, &tid);
while(1) while(1)
{ {
@ -2514,6 +2517,7 @@ static void test_menu_input(void) {
break; break;
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
} }
SetCursorPos(orig_pos.x, orig_pos.y);
DestroyWindow(hWnd); DestroyWindow(hWnd);
} }