if (FAILED_UNEXPECTEDLY(hResult))
return E_FAIL;
+// CORE-11140 : Disabled this bit, because it prevents the folder options from showing.
+// It returns 'E_NOTIMPL'
+#if 0
if (fCurrentShellView != NULL)
{
hResult = fCurrentShellView->AddPropertySheetPages(
if (FAILED_UNEXPECTEDLY(hResult))
return E_FAIL;
}
+#endif
// show sheet
m_PropSheet.dwSize = sizeof(PROPSHEETHEADER);
SHEnableMenuItem(theMenu, IDM_TOOLS_MAPNETWORKDRIVE, FALSE);
SHEnableMenuItem(theMenu, IDM_TOOLS_DISCONNECTNETWORKDRIVE, FALSE);
SHEnableMenuItem(theMenu, IDM_TOOLS_SYNCHRONIZE, FALSE);
- SHEnableMenuItem(theMenu, IDM_TOOLS_FOLDEROPTIONS, FALSE);
+ SHEnableMenuItem(theMenu, IDM_TOOLS_FOLDEROPTIONS, FALSE); // Remove when CORE-11141 is fixed.
menuIndex = 4;
}
else if (theMenu == SHGetMenuFromID(fCurrentMenuBar, FCIDM_MENU_HELP))
--- /dev/null
+/*
+ * Folder options.
+ *
+ * Copyright (C) 2016 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <precomp.h>
+
+
+WINE_DEFAULT_DEBUG_CHANNEL(fprop);
+
+CFolderOptions::CFolderOptions()
+ :m_pSite(NULL)
+{
+}
+
+CFolderOptions::~CFolderOptions()
+{
+}
+
+/*************************************************************************
+ * FolderOptions IShellPropSheetExt interface
+ */
+
+INT_PTR CALLBACK FolderOptionsGeneralDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK FolderOptionsViewDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK FolderOptionsFileTypesDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+HRESULT STDMETHODCALLTYPE CFolderOptions::AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
+{
+ HPROPSHEETPAGE hPage = SH_CreatePropertySheetPage(IDD_FOLDER_OPTIONS_GENERAL, FolderOptionsGeneralDlg, 0, NULL);
+
+ if (hPage == NULL)
+ {
+ ERR("Failed to create property sheet page FolderOptionsGeneral\n");
+ return E_FAIL;
+ }
+ if (!pfnAddPage(hPage, lParam))
+ return E_FAIL;
+
+ hPage = SH_CreatePropertySheetPage(IDD_FOLDER_OPTIONS_VIEW, FolderOptionsViewDlg, 0, NULL);
+ if (hPage == NULL)
+ {
+ ERR("Failed to create property sheet page FolderOptionsView\n");
+ return E_FAIL;
+ }
+ if (!pfnAddPage(hPage, lParam))
+ return E_FAIL;
+
+ hPage = SH_CreatePropertySheetPage(IDD_FOLDER_OPTIONS_FILETYPES, FolderOptionsFileTypesDlg, 0, NULL);
+ if (hPage == NULL)
+ {
+ ERR("Failed to create property sheet page FolderOptionsFileTypes\n");
+ return E_FAIL;
+ }
+ if (!pfnAddPage(hPage, lParam))
+ return E_FAIL;
+
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CFolderOptions::ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam)
+{
+ TRACE("(%p) (uPageID %u, pfnReplaceWith %p lParam %p\n", this, uPageID, pfnReplaceWith, lParam);
+ return E_NOTIMPL;
+}
+
+/*************************************************************************
+ * FolderOptions IShellExtInit interface
+ */
+
+HRESULT STDMETHODCALLTYPE CFolderOptions::Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID)
+{
+ return S_OK;
+}
+
+
+/*************************************************************************
+ * FolderOptions IShellExtInit interface
+ */
+HRESULT STDMETHODCALLTYPE CFolderOptions::SetSite(IUnknown *pUnkSite)
+{
+ m_pSite = pUnkSite;
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE CFolderOptions::GetSite(REFIID riid, void **ppvSite)
+{
+ return m_pSite->QueryInterface(riid, ppvSite);
+}
+
--- /dev/null
+/*
+ * Folder options.
+ *
+ * Copyright (C) 2016 Mark Jansen
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#ifndef _CFOLDEROPTIONS_H_
+#define _CFOLDEROPTIONS_H_
+
+class CFolderOptions :
+ public CComCoClass<CFolderOptions, &CLSID_ShellFldSetExt>,
+ public CComObjectRootEx<CComMultiThreadModelNoCS>,
+ public IShellPropSheetExt,
+ public IShellExtInit,
+ public IObjectWithSite
+{
+ private:
+ CComPtr<IUnknown> m_pSite;
+ //LPITEMIDLIST pidl;
+ //INT iIdEmpty;
+ //UINT cfShellIDList;
+ //void SF_RegisterClipFmt();
+ //BOOL fAcceptFmt; /* flag for pending Drop */
+ //BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect);
+ //BOOL RecycleBinIsEmpty();
+
+ public:
+ CFolderOptions();
+ ~CFolderOptions();
+
+ // IShellPropSheetExt
+ virtual HRESULT STDMETHODCALLTYPE AddPages(LPFNSVADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
+ virtual HRESULT STDMETHODCALLTYPE ReplacePage(EXPPS uPageID, LPFNSVADDPROPSHEETPAGE pfnReplaceWith, LPARAM lParam);
+
+ // IShellExtInit
+ virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID);
+
+ // IObjectWithSite
+ virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
+ virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite);
+
+ DECLARE_REGISTRY_RESOURCEID(IDR_FOLDEROPTIONS)
+ DECLARE_NOT_AGGREGATABLE(CFolderOptions)
+
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CFolderOptions)
+ COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
+ COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
+ COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
+ END_COM_MAP()
+};
+
+#endif /* _CFOLDEROPTIONS_H_ */
shell32.cpp
CShellItem.cpp
CShellLink.cpp
+ CFolderOptions.cpp
folders/CDesktopFolder.cpp
folders/CFSFolder.cpp
folders/CDrivesFolder.cpp
EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
-static
INT_PTR
CALLBACK
FolderOptionsGeneralDlg(
}
-static
INT_PTR
CALLBACK
FolderOptionsViewDlg(
return NULL;
}
-static
INT_PTR
CALLBACK
FolderOptionsFileTypesDlg(
#include "CFolder.h"
#include "CShell.h"
#include "CDropTargetHelper.h"
+#include "CFolderOptions.h"
#include "folders/CFSFolder.h"
#include "folders/CDrivesFolder.h"
#include "folders/CDesktopFolder.h"
val Attributes = d '0'
}
}
+ ForceRemove {6D5313C0-8C62-11D1-B2CD-006097DF8C11} = s 'Folder Options Property Page Extension'
+ {
+ InprocServer32 = s '%MODULE%'
+ {
+ val ThreadingModel = s 'Apartment'
+ }
+ }
}
}
HKLM
OBJECT_ENTRY(CLSID_FontsFolderShortcut, CFontsFolder)
OBJECT_ENTRY(CLSID_Printers, CPrinterFolder)
OBJECT_ENTRY(CLSID_AdminFolderShortcut, CAdminToolsFolder)
+ OBJECT_ENTRY(CLSID_ShellFldSetExt, CFolderOptions)
OBJECT_ENTRY(CLSID_RecycleBin, CRecycleBin)
OBJECT_ENTRY(CLSID_OpenWithMenu, COpenWithMenu)
OBJECT_ENTRY(CLSID_NewMenu, CNewMenu)