[SHELL32] -CMenuBand::SetSite: Don't fail if the site doesn't support the SID_STopLev...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 18 Jun 2017 12:34:30 +0000 (12:34 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 18 Jun 2017 12:34:30 +0000 (12:34 +0000)
svn path=/trunk/; revision=75090

reactos/dll/win32/shell32/shellmenu/CMenuBand.cpp

index 78b10e3..ca0f0d4 100644 (file)
@@ -240,10 +240,18 @@ HRESULT STDMETHODCALLTYPE  CMenuBand::SetSite(IUnknown *pUnkSite)
 
     CComPtr<IOleWindow> pTopLevelWindow;
     hr = IUnknown_QueryService(m_site, SID_STopLevelBrowser, IID_PPV_ARG(IOleWindow, &pTopLevelWindow));
-    if (FAILED_UNEXPECTEDLY(hr))
-        return hr;
+    if (SUCCEEDED(hr))
+    {
+        hr = pTopLevelWindow->GetWindow(&m_topLevelWindow);
+        if (FAILED_UNEXPECTEDLY(hr))
+            return hr;
+    }
+    else
+    {
+        m_topLevelWindow = hwndParent;
+    }
 
-    return pTopLevelWindow->GetWindow(&m_topLevelWindow);
+    return S_OK;
 }
 
 HRESULT STDMETHODCALLTYPE  CMenuBand::GetSite(REFIID riid, PVOID *ppvSite)