[SHELL32] - CNetFolder: Fix opening items which was broken after having a callback...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 16 Dec 2016 10:31:13 +0000 (10:31 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 16 Dec 2016 10:31:13 +0000 (10:31 +0000)
svn path=/trunk/; revision=73459

reactos/dll/win32/shell32/folders/CNetFolder.cpp

index 9284331..fa9477a 100644 (file)
@@ -61,6 +61,25 @@ HRESULT CNetFolderExtractIcon_CreateInstance(LPCITEMIDLIST pidl, REFIID riid, LP
     return initIcon->QueryInterface(riid, ppvOut);
 }
 
+HRESULT CALLBACK NetFolderMenuCallback(IShellFolder *psf,
+                                       HWND         hwnd,
+                                       IDataObject  *pdtobj,
+                                       UINT         uMsg,
+                                       WPARAM       wParam,
+                                       LPARAM       lParam)
+{
+    switch (uMsg)
+    {
+    case DFM_MERGECONTEXTMENU:
+        return S_OK;
+    case DFM_INVOKECOMMAND:
+    case DFM_INVOKECOMMANDEX:
+    case DFM_GETDEFSTATICID: // Required for Windows 7 to pick a default
+        return S_FALSE;
+    }
+    return E_NOTIMPL;
+}
+
 class CNetFolderEnum :
     public CEnumIDListBase
 {
@@ -421,7 +440,7 @@ HRESULT WINAPI CNetFolder::GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CH
         HKEY hkey;
         UINT cKeys = 0;
         AddClassKeyToArray(L"Folder", &hkey, &cKeys);
-        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, cKeys, &hkey, &pCm);
+        hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, this, NetFolderMenuCallback, cKeys, &hkey, &pCm);
         pObj = pCm;
     }
     else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))