- IOleWindow *OleWindow;
-
- /* Check if the site supports IOleWindow */
- hRet = pUnkSite->QueryInterface(IID_PPV_ARG(IOleWindow, &OleWindow));
- if (SUCCEEDED(hRet))
- {
- HWND hWndParent = NULL;
-
- hRet = OleWindow->GetWindow(
- &hWndParent);
- if (SUCCEEDED(hRet))
- {
- /* Attempt to create the task switch window */
-
- TRACE("CreateTaskSwitchWnd(Parent: 0x%p)\n", hWndParent);
- hWnd = CreateTaskSwitchWnd(hWndParent, Tray);
- if (hWnd != NULL)
- {
- punkSite = pUnkSite;
- hRet = S_OK;
- }
- else
- {
- TRACE("CreateTaskSwitchWnd() failed!\n");
- OleWindow->Release();
- hRet = E_FAIL;
- }
- }
- else
- OleWindow->Release();
- }
- else
- TRACE("Querying IOleWindow failed: 0x%x\n", hRet);