dinput/tests: Skip acquire tests when not running in the foreground.

If our window isn't the foreground window, we'll never be able to
successfully Acquire with SetCooperativeLevel DISCL_FOREGROUND in effect.
This commit is contained in:
Greg Geldorp 2011-01-06 13:10:27 +01:00 committed by Alexandre Julliard
parent 01286b97e3
commit 62670dc39e
1 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,12 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
DIMOUSESTATE m_state;
HWND hwnd2;
if (! SetForegroundWindow(hwnd))
{
skip("Not running as foreground app, skipping acquire tests\n");
return;
}
hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, &pMouse, NULL);
ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
if (FAILED(hr)) return;