Author: mjansen
Date: Sat Apr 23 23:05:07 2016
New Revision: 71192

URL: http://svn.reactos.org/svn/reactos?rev=71192&view=rev
Log:
[BROWSEUI][SHELL32] Stub Folder Options Property Page extension CORE-10837
- Stub the Property pages
- Disable some code that prevented the property pages from working (CORE-11140)
- Leave the menu item disabled for now, since a dialog that does not do 
anything will only confuse people (CORE-11141)

Added:
    trunk/reactos/dll/win32/shell32/CFolderOptions.cpp   (with props)
    trunk/reactos/dll/win32/shell32/CFolderOptions.h   (with props)
Modified:
    trunk/reactos/dll/win32/browseui/shellbrowser.cpp
    trunk/reactos/dll/win32/shell32/CMakeLists.txt
    trunk/reactos/dll/win32/shell32/dialogs/folder_options.cpp
    trunk/reactos/dll/win32/shell32/precomp.h
    trunk/reactos/dll/win32/shell32/res/rgs/folderoptions.rgs
    trunk/reactos/dll/win32/shell32/shell32.cpp

Modified: trunk/reactos/dll/win32/browseui/shellbrowser.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/shellbrowser.cpp?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/browseui/shellbrowser.cpp   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/shellbrowser.cpp   [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -1254,6 +1254,9 @@
     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(
@@ -1261,6 +1264,7 @@
         if (FAILED_UNEXPECTEDLY(hResult))
             return E_FAIL;
     }
+#endif
 
     // show sheet
     m_PropSheet.dwSize = sizeof(PROPSHEETHEADER);
@@ -3203,7 +3207,7 @@
         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))

Added: trunk/reactos/dll/win32/shell32/CFolderOptions.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderOptions.cpp?rev=71192
==============================================================================
--- trunk/reactos/dll/win32/shell32/CFolderOptions.cpp  (added)
+++ trunk/reactos/dll/win32/shell32/CFolderOptions.cpp  [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -0,0 +1,105 @@
+/*
+ * 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);
+}
+

Propchange: trunk/reactos/dll/win32/shell32/CFolderOptions.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/shell32/CFolderOptions.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CFolderOptions.h?rev=71192
==============================================================================
--- trunk/reactos/dll/win32/shell32/CFolderOptions.h    (added)
+++ trunk/reactos/dll/win32/shell32/CFolderOptions.h    [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -0,0 +1,68 @@
+/*
+ * 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_ */

Propchange: trunk/reactos/dll/win32/shell32/CFolderOptions.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/win32/shell32/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CMakeLists.txt?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/CMakeLists.txt      [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CMakeLists.txt      [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -42,6 +42,7 @@
     shell32.cpp
     CShellItem.cpp
     CShellLink.cpp
+    CFolderOptions.cpp
     folders/CDesktopFolder.cpp
     folders/CFSFolder.cpp
     folders/CDrivesFolder.cpp

Modified: trunk/reactos/dll/win32/shell32/dialogs/folder_options.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/folder_options.cpp?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/folder_options.cpp  [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/dialogs/folder_options.cpp  [iso-8859-1] 
Sat Apr 23 23:05:07 2016
@@ -83,7 +83,6 @@
 
 EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR 
pszSubKey, UINT max_iface, IDataObject *pDataObj);
 
-static
 INT_PTR
 CALLBACK
 FolderOptionsGeneralDlg(
@@ -124,7 +123,6 @@
 
 }
 
-static
 INT_PTR
 CALLBACK
 FolderOptionsViewDlg(
@@ -384,7 +382,6 @@
     return NULL;
 }
 
-static
 INT_PTR
 CALLBACK
 FolderOptionsFileTypesDlg(

Modified: trunk/reactos/dll/win32/shell32/precomp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/precomp.h?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/precomp.h   [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/precomp.h   [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -55,6 +55,7 @@
 #include "CFolder.h"
 #include "CShell.h"
 #include "CDropTargetHelper.h"
+#include "CFolderOptions.h"
 #include "folders/CFSFolder.h"
 #include "folders/CDrivesFolder.h"
 #include "folders/CDesktopFolder.h"

Modified: trunk/reactos/dll/win32/shell32/res/rgs/folderoptions.rgs
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/res/rgs/folderoptions.rgs?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/res/rgs/folderoptions.rgs   [iso-8859-1] 
(original)
+++ trunk/reactos/dll/win32/shell32/res/rgs/folderoptions.rgs   [iso-8859-1] 
Sat Apr 23 23:05:07 2016
@@ -27,6 +27,13 @@
                                val Attributes = d '0'
                        }
                }
+               ForceRemove {6D5313C0-8C62-11D1-B2CD-006097DF8C11} = s 'Folder 
Options Property Page Extension'
+               {
+                       InprocServer32 = s '%MODULE%'
+                       {
+                               val ThreadingModel = s 'Apartment'
+                       }
+               }
        }
 }
 HKLM

Modified: trunk/reactos/dll/win32/shell32/shell32.cpp
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.cpp?rev=71192&r1=71191&r2=71192&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] Sat Apr 23 
23:05:07 2016
@@ -204,6 +204,7 @@
     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)


Reply via email to