1 /* 2 * PROJECT: ReactOS shell extensions 3 * LICENSE: GPL - See COPYING in the top level directory 4 * FILE: dll/shellext/ntobjshex/regfolder.h 5 * PURPOSE: NT Object Namespace shell extension 6 * PROGRAMMERS: David Quintana <gigaherz@gmail.com> 7 */ 8 #pragma once 9 10 extern const GUID CLSID_RegistryFolder; 11 12 class CRegistryFolder : 13 public CComCoClass<CRegistryFolder, &CLSID_RegistryFolder>, 14 public CComObjectRootEx<CComMultiThreadModelNoCS>, 15 public IShellFolder2, 16 public IPersistFolder2, 17 public IShellFolderViewCB 18 { 19 HKEY m_hRoot; 20 WCHAR m_NtPath[MAX_PATH]; 21 22 LPITEMIDLIST m_shellPidl; 23 24 public: 25 26 CRegistryFolder(); 27 virtual ~CRegistryFolder(); 28 29 // IShellFolder 30 virtual HRESULT STDMETHODCALLTYPE ParseDisplayName( 31 HWND hwndOwner, 32 LPBC pbcReserved, 33 LPOLESTR lpszDisplayName, 34 ULONG *pchEaten, 35 LPITEMIDLIST *ppidl, 36 ULONG *pdwAttributes); 37 38 virtual HRESULT STDMETHODCALLTYPE EnumObjects( 39 HWND hwndOwner, 40 SHCONTF grfFlags, 41 IEnumIDList **ppenumIDList); 42 43 virtual HRESULT STDMETHODCALLTYPE BindToObject( 44 LPCITEMIDLIST pidl, 45 LPBC pbcReserved, 46 REFIID riid, 47 void **ppvOut); 48 49 virtual HRESULT STDMETHODCALLTYPE BindToStorage( 50 LPCITEMIDLIST pidl, 51 LPBC pbcReserved, 52 REFIID riid, 53 void **ppvObj); 54 55 virtual HRESULT STDMETHODCALLTYPE CompareIDs( 56 LPARAM lParam, 57 LPCITEMIDLIST pidl1, 58 LPCITEMIDLIST pidl2); 59 60 virtual HRESULT STDMETHODCALLTYPE CreateViewObject( 61 HWND hwndOwner, 62 REFIID riid, 63 void **ppvOut); 64 65 virtual HRESULT STDMETHODCALLTYPE GetAttributesOf( 66 UINT cidl, 67 PCUITEMID_CHILD_ARRAY apidl, 68 SFGAOF *rgfInOut); 69 70 virtual HRESULT STDMETHODCALLTYPE GetUIObjectOf( 71 HWND hwndOwner, 72 UINT cidl, 73 PCUITEMID_CHILD_ARRAY apidl, 74 REFIID riid, 75 UINT *prgfInOut, 76 void **ppvOut); 77 78 virtual HRESULT STDMETHODCALLTYPE GetDisplayNameOf( 79 LPCITEMIDLIST pidl, 80 SHGDNF uFlags, 81 STRRET *lpName); 82 83 virtual HRESULT STDMETHODCALLTYPE SetNameOf( 84 HWND hwnd, 85 LPCITEMIDLIST pidl, 86 LPCOLESTR lpszName, 87 SHGDNF uFlags, 88 LPITEMIDLIST *ppidlOut); 89 90 // IShellFolder2 91 virtual HRESULT STDMETHODCALLTYPE GetDefaultSearchGUID( 92 GUID *lpguid); 93 94 virtual HRESULT STDMETHODCALLTYPE EnumSearches( 95 IEnumExtraSearch **ppenum); 96 97 virtual HRESULT STDMETHODCALLTYPE GetDefaultColumn( 98 DWORD dwReserved, 99 ULONG *pSort, 100 ULONG *pDisplay); 101 102 virtual HRESULT STDMETHODCALLTYPE GetDefaultColumnState( 103 UINT iColumn, 104 SHCOLSTATEF *pcsFlags); 105 106 virtual HRESULT STDMETHODCALLTYPE GetDetailsEx( 107 LPCITEMIDLIST pidl, 108 const SHCOLUMNID *pscid, 109 VARIANT *pv); 110 111 virtual HRESULT STDMETHODCALLTYPE GetDetailsOf( 112 LPCITEMIDLIST pidl, 113 UINT iColumn, 114 SHELLDETAILS *psd); 115 116 virtual HRESULT STDMETHODCALLTYPE MapColumnToSCID( 117 UINT iColumn, 118 SHCOLUMNID *pscid); 119 120 // IPersist 121 virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *lpClassId); 122 123 // IPersistFolder 124 virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl); 125 126 // IPersistFolder2 127 virtual HRESULT STDMETHODCALLTYPE GetCurFolder(LPITEMIDLIST * pidl); 128 129 // IShellFolderViewCB 130 virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam); 131 132 // Internal 133 HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidl, PCWSTR ntPath, HKEY hRoot); 134 135 static HRESULT CALLBACK DefCtxMenuCallback(IShellFolder *, HWND, IDataObject *, UINT, WPARAM, LPARAM); 136 137 DECLARE_REGISTRY_RESOURCEID(IDR_REGISTRYFOLDER) 138 DECLARE_NOT_AGGREGATABLE(CRegistryFolder) 139 DECLARE_PROTECT_FINAL_CONSTRUCT() 140 141 BEGIN_COM_MAP(CRegistryFolder) 142 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder) 143 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2) 144 COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) 145 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder) 146 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2) 147 COM_INTERFACE_ENTRY_IID(IID_IShellFolderViewCB, IShellFolderViewCB) 148 END_COM_MAP() 149 150 };