static void create_test_windows() { RegisterSimpleClass(OwnerTestProc, L"ownertest"); hWnd1 = CreateWindowW(L"ownertest", L"ownertest", WS_OVERLAPPEDWINDOW, 20, 20, 300, 300, NULL, NULL, 0, NULL); hWnd2 = CreateWindowW(L"ownertest", L"ownertest", WS_OVERLAPPEDWINDOW, 200, 200, 300, 300, NULL, NULL, 0, NULL); }
BOOLEAN InitThreads() { /* Create a LL hook that drops any physical keyboard and mouse action and prevent the user from interfering with the test results */ if(!IsDebuggerPresent()) { hMouseHookLL = SetWindowsHookExW(WH_MOUSE_LL, MouseLLHookProc, GetModuleHandleW( NULL ), 0); ok(hMouseHookLL!=NULL,"failed to set hook\n"); hKbdHookLL = SetWindowsHookExW(WH_KEYBOARD_LL, KbdLLHookProc, GetModuleHandleW( NULL ), 0); ok(hKbdHookLL!=NULL,"failed to set hook\n"); } /* create test clases */ RegisterSimpleClass(TestProc, L"TestClass"); memset(&data[0], 0, sizeof(data[0])); data[0].tid = GetCurrentThreadId(); /* create test window */ data[0].hWnd = CreateWindowW(L"TestClass", L"test", WS_OVERLAPPEDWINDOW, 100, 100, 500, 500, NULL, NULL, 0, NULL); if(!data[0].hWnd) { win_skip("CreateWindowW failed\n"); return FALSE; } /* create thread1(same desktop) */ if(!CreateTestThread(1, NULL)) return FALSE; /* create thread2(same desktop) */ if(!CreateTestThread(2, NULL)) return FALSE; /* ugly ros hack to bypass desktop crapiness */ if(!CreateTestThread(6, L"ThreadTestDesktop")) return FALSE; /* create thread3(different desktop) */ if(!CreateTestThread(3, L"ThreadTestDesktop")) return FALSE; /* create thread4(different desktop) */ if(!CreateTestThread(4, L"ThreadTestDesktop")) return FALSE; return TRUE; }
static void create_test_windows() { hMouseHookLL = SetWindowsHookExW(WH_MOUSE_LL, MouseLLHookProc, GetModuleHandleW( NULL ), 0); hMouseHook = SetWindowsHookExW(WH_MOUSE, MouseHookProc, GetModuleHandleW( NULL ), GetCurrentThreadId()); ok(hMouseHook!=NULL,"failed to set hook\n"); ok(hMouseHookLL!=NULL,"failed to set hook\n"); RegisterSimpleClass(TmeTestProc, L"testClass"); hWnd1 = CreateWindowW(L"testClass", L"test", WS_OVERLAPPEDWINDOW, 100, 100, 500, 500, NULL, NULL, 0, NULL); hWnd2 = CreateWindowW(L"testClass", L"test", WS_CHILD, 50, 50, 200, 200, hWnd1, NULL, 0, NULL); hWnd3 = CreateWindowW(L"testClass", L"test", WS_CHILD, 150, 150, 200, 200, hWnd1, NULL, 0, NULL); ShowWindow(hWnd1, SW_SHOW); UpdateWindow(hWnd1); ShowWindow(hWnd2, SW_SHOW); UpdateWindow(hWnd2); ShowWindow(hWnd3, SW_SHOWNORMAL); UpdateWindow(hWnd3); //SetWindowPos (hWnd3, HWND_TOP, 0,0,0,0, SWP_NOMOVE|SWP_NOREDRAW); }