From f922283335ba93fea0df4e685f2298e2077328ac Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 2 Jun 2009 11:56:58 +0200 Subject: [PATCH] user32/tests: Only check the foreground window when it belongs to the current thread. --- dlls/user32/tests/win.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 13e5d67e4c1..43988b5e474 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -2322,7 +2322,10 @@ static void check_wnd_state_(const char *file, int line, HWND active, HWND foreground, HWND focus, HWND capture) { ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); - if (foreground && GetForegroundWindow()) + /* only check foreground if it belongs to the current thread */ + /* foreground can be moved to a different app pretty much at any time */ + if (foreground && GetForegroundWindow() && + GetWindowThreadProcessId(GetForegroundWindow(), NULL) == GetCurrentThreadId()) ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture());