Commit 2f26e385 authored by Qian Hong's avatar Qian Hong Committed by Alexandre Julliard

user32/tests: Make sure to allow setting the foreground window.

parent b6b9ea76
...@@ -765,7 +765,7 @@ static void test_foregroundwindow(void) ...@@ -765,7 +765,7 @@ static void test_foregroundwindow(void)
int thread_desk_id, input_desk_id, hwnd_id; int thread_desk_id, input_desk_id, hwnd_id;
WNDCLASSA wclass; WNDCLASSA wclass;
wnd_param param; wnd_param param;
DWORD ret; DWORD ret, timeout, timeout_old;
char win_text[1024]; char win_text[1024];
#define DESKTOPS 2 #define DESKTOPS 2
...@@ -803,6 +803,16 @@ static void test_foregroundwindow(void) ...@@ -803,6 +803,16 @@ static void test_foregroundwindow(void)
trace("hwnd0 %p hwnd1 %p partner0 %p partner1 %p\n", hwnds[0], hwnds[1], partners[0], partners[1]); trace("hwnd0 %p hwnd1 %p partner0 %p partner1 %p\n", hwnds[0], hwnds[1], partners[0], partners[1]);
ret = SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout_old, 0);
ok(ret, "get foreground lock timeout failed!\n");
trace("old timeout %d\n", timeout_old);
timeout = 0;
ret = SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
ok(ret, "set foreground lock timeout failed!\n");
ret = SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout, 0);
ok(ret, "get foreground lock timeout failed!\n");
ok(timeout == 0, "unexpected timeout %d\n", timeout);
for (hwnd_id = 0; hwnd_id < DESKTOPS; hwnd_id++) for (hwnd_id = 0; hwnd_id < DESKTOPS; hwnd_id++)
for (thread_desk_id = 0; thread_desk_id < DESKTOPS; thread_desk_id++) for (thread_desk_id = 0; thread_desk_id < DESKTOPS; thread_desk_id++)
for (input_desk_id = 0; input_desk_id < DESKTOPS; input_desk_id++) for (input_desk_id = 0; input_desk_id < DESKTOPS; input_desk_id++)
...@@ -864,6 +874,12 @@ static void test_foregroundwindow(void) ...@@ -864,6 +874,12 @@ static void test_foregroundwindow(void)
ret = SwitchDesktop(hdesks[0]); ret = SwitchDesktop(hdesks[0]);
ok(ret, "switch desktop failed!\n"); ok(ret, "switch desktop failed!\n");
CloseDesktop(hdesks[1]); CloseDesktop(hdesks[1]);
ret = SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UlongToPtr(timeout_old), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
ok(ret, "set foreground lock timeout failed!\n");
ret = SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout, 0);
ok(ret, "get foreground lock timeout failed!\n");
ok(timeout == timeout_old, "unexpected timeout %d\n", timeout);
} }
START_TEST(winstation) START_TEST(winstation)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment