Index: AttachThreadInput.c =================================================================== --- AttachThreadInput.c (revision 57195) +++ AttachThreadInput.c (working copy) @@ -227,9 +227,35 @@ } } +/* + * Preliminary test to assure proper results. + */ +void Test_SetActiveForeground() +{ + trace("hWnd0 0x%p hWnd1 0x%p\n",data[0].hWnd,data[1].hWnd); + trace("Forground 1 hWnd 0x%p\n",GetForegroundWindow()); + SetForegroundWindow(data[1].hWnd); + trace("Forground 2 hWnd 0x%p expected 0x%p\n",GetForegroundWindow(), data[1].hWnd); + SetActiveWindow(data[0].hWnd); + trace("Forground 3 hWnd 0x%p expected 0x%p\n",GetForegroundWindow(), data[1].hWnd); + FlushMessages(); + EXPECT_FOREGROUND(data[1].hWnd); + EXPECT_ACTIVE(data[0].hWnd); + + SetForegroundWindow(data[0].hWnd); + trace("Forground 4 hWnd 0x%p expected 0x%p\n",GetForegroundWindow(), data[0].hWnd); + SetActiveWindow(data[1].hWnd); + trace("Forground 5 hWnd 0x%p expected 0x%p\n",GetForegroundWindow(), data[0].hWnd); + FlushMessages(); + + EXPECT_FOREGROUND(data[0].hWnd); + EXPECT_ACTIVE(data[0].hWnd); +} + + /* * The actual tests */ @@ -557,7 +583,7 @@ SetForegroundWindow(data[1].hWnd); SetActiveWindow(data[0].hWnd); - ok(GetForegroundWindow() == data[1].hWnd, "wrong foreground\n"); + ok(GetForegroundWindow() == data[1].hWnd, "wrong foreground got 0x%p\n",data[1].hWnd); ok(GetActiveWindow() == data[0].hWnd, "wrong active\n"); FlushMessages(); @@ -657,15 +683,16 @@ if(!InitThreads()) return; - win_skip("skip Test_SimpleParameters that crash ros\n"); - //Test_SimpleParameters(); - //cleanup_attachments(); + Test_SetActiveForeground(); +/* win_skip("skip Test_SimpleParameters that crash ros\n"); + Test_SimpleParameters(); + cleanup_attachments(); Test_Focus(); cleanup_attachments(); Test_UnaffectedMessages(); cleanup_attachments(); Test_SendInput(); - cleanup_attachments(); +*/ cleanup_attachments(); if(hMouseHookLL) UnhookWindowsHookEx(hMouseHookLL);