diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 6ab51fad0e7..ff3e409862d 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3193,7 +3193,7 @@ static void test_coop_level_activateapp(void) WS_MAXIMIZE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); /* Exclusive with window already active. */ - SetActiveWindow(window); + SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3202,7 +3202,7 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Exclusive with window not active. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3211,30 +3211,26 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Normal with window not active, then exclusive with the same window. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP when setting DDSCL_NORMAL.\n"); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - /* Except in the first SetCooperativeLevel call, Windows XP randomly does not send - * WM_ACTIVATEAPP. Windows 7 sends the message reliably. Mark the XP behavior broken. */ - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Recursive set of DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3249,15 +3245,14 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Setting DDSCL_NORMAL with recursive invocation. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); /* DDraw is in exlusive mode now. */ memset(&ddsd, 0, sizeof(ddsd)); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index b79aed6c065..4181f1cd118 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -3756,7 +3756,7 @@ static void test_coop_level_activateapp(void) WS_MAXIMIZE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); /* Exclusive with window already active. */ - SetActiveWindow(window); + SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3765,7 +3765,7 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Exclusive with window not active. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3774,30 +3774,26 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Normal with window not active, then exclusive with the same window. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP when setting DDSCL_NORMAL.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - /* Except in the first SetCooperativeLevel call, Windows XP randomly does not send - * WM_ACTIVATEAPP. Windows 7 sends the message reliably. Mark the XP behavior broken. */ - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Recursive set of DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw2_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3812,15 +3808,14 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Setting DDSCL_NORMAL with recursive invocation. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); /* DDraw is in exlusive mode now. */ memset(&ddsd, 0, sizeof(ddsd)); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index fb20d702a87..9c02ec552d4 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -4111,7 +4111,7 @@ static void test_coop_level_activateapp(void) WS_MAXIMIZE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); /* Exclusive with window already active. */ - SetActiveWindow(window); + SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -4120,7 +4120,7 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Exclusive with window not active. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -4129,30 +4129,26 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Normal with window not active, then exclusive with the same window. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP when setting DDSCL_NORMAL.\n"); hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - /* Except in the first SetCooperativeLevel call, Windows XP randomly does not send - * WM_ACTIVATEAPP. Windows 7 sends the message reliably. Mark the XP behavior broken. */ - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Recursive set of DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw4_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -4167,15 +4163,14 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Setting DDSCL_NORMAL with recursive invocation. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); /* DDraw is in exlusive mode now. */ memset(&ddsd, 0, sizeof(ddsd)); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 0ac7d7e67bd..d03f4b0455c 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -3879,7 +3879,7 @@ static void test_coop_level_activateapp(void) WS_MAXIMIZE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); /* Exclusive with window already active. */ - SetActiveWindow(window); + SetForegroundWindow(window); activateapp_testdata.received = FALSE; hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3888,7 +3888,7 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Exclusive with window not active. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3897,30 +3897,26 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Normal with window not active, then exclusive with the same window. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); ok(!activateapp_testdata.received, "Received WM_ACTIVATEAPP when setting DDSCL_NORMAL.\n"); hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - /* Except in the first SetCooperativeLevel call, Windows XP randomly does not send - * WM_ACTIVATEAPP. Windows 7 sends the message reliably. Mark the XP behavior broken. */ - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Recursive set of DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN; hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); hr = IDirectDraw7_SetCooperativeLevel(ddraw, NULL, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -3935,15 +3931,14 @@ static void test_coop_level_activateapp(void) ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); /* Setting DDSCL_NORMAL with recursive invocation. */ - SetActiveWindow(NULL); + SetForegroundWindow(GetDesktopWindow()); activateapp_testdata.received = FALSE; activateapp_testdata.ddraw = ddraw; activateapp_testdata.window = window; activateapp_testdata.coop_level = DDSCL_NORMAL; hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - ok(activateapp_testdata.received || broken(!activateapp_testdata.received), - "Expected WM_ACTIVATEAPP, but did not receive it.\n"); + ok(activateapp_testdata.received, "Expected WM_ACTIVATEAPP, but did not receive it.\n"); /* DDraw is in exlusive mode now. */ memset(&ddsd, 0, sizeof(ddsd));