user32/tests: Skip tests instead of crashing if global hook cannot be set.

This commit is contained in:
Alexandre Julliard 2008-03-03 17:51:42 +01:00
parent 57786d84a1
commit 9ac7f20514
1 changed files with 6 additions and 1 deletions

View File

@ -7239,7 +7239,12 @@ static void test_winevents(void)
/****** start of global hook test *************/
hCBT_global_hook = SetWindowsHookExA(WH_CBT, cbt_global_hook_proc, GetModuleHandleA(0), 0);
assert(hCBT_global_hook);
if (!hCBT_global_hook)
{
ok(DestroyWindow(hwnd), "failed to destroy window\n");
skip( "cannot set global hook\n" );
return;
}
hevent = CreateEventA(NULL, 0, 0, NULL);
assert(hevent);