1c2c66affSColin Finck /* 2ba03ffd6SStanislav Motylkov * PROJECT: NT Object Namespace shell extension 3ba03ffd6SStanislav Motylkov * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4ba03ffd6SStanislav Motylkov * PURPOSE: System Registry folder class header 5ba03ffd6SStanislav Motylkov * COPYRIGHT: Copyright 2015-2017 David Quintana <gigaherz@gmail.com> 6c2c66affSColin Finck */ 7ba03ffd6SStanislav Motylkov 8c2c66affSColin Finck #pragma once 9c2c66affSColin Finck 10c2c66affSColin Finck extern const GUID CLSID_RegistryFolder; 11c2c66affSColin Finck 12c2c66affSColin Finck class CRegistryFolderExtractIcon : 13c2c66affSColin Finck public CComObjectRootEx<CComMultiThreadModelNoCS>, 14c2c66affSColin Finck public IExtractIconW 15c2c66affSColin Finck { 16c2c66affSColin Finck PCIDLIST_ABSOLUTE m_pcidlFolder; 17c2c66affSColin Finck PCITEMID_CHILD m_pcidlChild; 18c2c66affSColin Finck 19c2c66affSColin Finck public: 20c2c66affSColin Finck CRegistryFolderExtractIcon(); 21c2c66affSColin Finck 22c2c66affSColin Finck virtual ~CRegistryFolderExtractIcon(); 23c2c66affSColin Finck 24c2c66affSColin Finck HRESULT Initialize(LPCWSTR ntPath, PCIDLIST_ABSOLUTE parent, UINT cidl, PCUITEMID_CHILD_ARRAY apidl); 25c2c66affSColin Finck 26*de8e1553SKatayama Hirofumi MZ STDMETHOD(GetIconLocation)( 27c2c66affSColin Finck UINT uFlags, 28c2c66affSColin Finck LPWSTR szIconFile, 29c2c66affSColin Finck UINT cchMax, 30c2c66affSColin Finck INT *piIndex, 31*de8e1553SKatayama Hirofumi MZ UINT *pwFlags) override; 32c2c66affSColin Finck 33*de8e1553SKatayama Hirofumi MZ STDMETHOD(Extract)( 34c2c66affSColin Finck LPCWSTR pszFile, 35c2c66affSColin Finck UINT nIconIndex, 36c2c66affSColin Finck HICON *phiconLarge, 37c2c66affSColin Finck HICON *phiconSmall, 38*de8e1553SKatayama Hirofumi MZ UINT nIconSize) override; 39c2c66affSColin Finck 40c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CRegistryFolderExtractIcon) 41c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT() 42c2c66affSColin Finck 43c2c66affSColin Finck BEGIN_COM_MAP(CRegistryFolderExtractIcon) 44c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW) 45c2c66affSColin Finck END_COM_MAP() 46c2c66affSColin Finck 47c2c66affSColin Finck }; 48c2c66affSColin Finck 49c2c66affSColin Finck class CRegistryFolder : 50c2c66affSColin Finck public CComCoClass<CRegistryFolder, &CLSID_RegistryFolder>, 51c2c66affSColin Finck public CCommonFolder<CRegistryFolder, RegPidlEntry, CRegistryFolderExtractIcon> 52c2c66affSColin Finck { 53c2c66affSColin Finck HKEY m_hRoot; 54c2c66affSColin Finck 55c2c66affSColin Finck public: 56c2c66affSColin Finck DECLARE_REGISTRY_RESOURCEID(IDR_REGISTRYFOLDER) 57c2c66affSColin Finck 58c2c66affSColin Finck CRegistryFolder(); 59c2c66affSColin Finck virtual ~CRegistryFolder(); 60c2c66affSColin Finck 61c2c66affSColin Finck // IShellFolder 62*de8e1553SKatayama Hirofumi MZ STDMETHOD(EnumObjects)( 63c2c66affSColin Finck HWND hwndOwner, 64c2c66affSColin Finck SHCONTF grfFlags, 65*de8e1553SKatayama Hirofumi MZ IEnumIDList **ppenumIDList) override; 66c2c66affSColin Finck 67c2c66affSColin Finck protected: 68*de8e1553SKatayama Hirofumi MZ STDMETHOD(InternalBindToObject)( 69c2c66affSColin Finck PWSTR path, 70c2c66affSColin Finck const RegPidlEntry * info, 71c2c66affSColin Finck LPITEMIDLIST first, 72c2c66affSColin Finck LPCITEMIDLIST rest, 73c2c66affSColin Finck LPITEMIDLIST fullPidl, 74c2c66affSColin Finck LPBC pbcReserved, 75*de8e1553SKatayama Hirofumi MZ IShellFolder** ppsfChild) override; 76c2c66affSColin Finck 77c2c66affSColin Finck public: 78*de8e1553SKatayama Hirofumi MZ STDMETHOD(GetDefaultColumnState)( 79c2c66affSColin Finck UINT iColumn, 80*de8e1553SKatayama Hirofumi MZ SHCOLSTATEF *pcsFlags) override; 81c2c66affSColin Finck 82*de8e1553SKatayama Hirofumi MZ STDMETHOD(GetDetailsEx)( 83c2c66affSColin Finck LPCITEMIDLIST pidl, 84c2c66affSColin Finck const SHCOLUMNID *pscid, 85*de8e1553SKatayama Hirofumi MZ VARIANT *pv) override; 86c2c66affSColin Finck 87*de8e1553SKatayama Hirofumi MZ STDMETHOD(GetDetailsOf)( 88c2c66affSColin Finck LPCITEMIDLIST pidl, 89c2c66affSColin Finck UINT iColumn, 90*de8e1553SKatayama Hirofumi MZ SHELLDETAILS *psd) override; 91c2c66affSColin Finck 92*de8e1553SKatayama Hirofumi MZ STDMETHOD(MapColumnToSCID)( 93c2c66affSColin Finck UINT iColumn, 94*de8e1553SKatayama Hirofumi MZ SHCOLUMNID *pscid) override; 95c2c66affSColin Finck 96c2c66affSColin Finck // IPersistFolder 97*de8e1553SKatayama Hirofumi MZ STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidl) override; 98c2c66affSColin Finck 99c2c66affSColin Finck // Internal 100*de8e1553SKatayama Hirofumi MZ STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidl, PCWSTR ntPath, HKEY hRoot); 101c2c66affSColin Finck 102c2c66affSColin Finck protected: 103*de8e1553SKatayama Hirofumi MZ STDMETHOD(CompareIDs)(LPARAM lParam, const RegPidlEntry * first, const RegPidlEntry * second); 104*de8e1553SKatayama Hirofumi MZ STDMETHOD_(ULONG, ConvertAttributes)(const RegPidlEntry * entry, PULONG inMask); 105*de8e1553SKatayama Hirofumi MZ STDMETHOD_(BOOL, IsFolder)(const RegPidlEntry * info); 106c2c66affSColin Finck 107c2c66affSColin Finck virtual HRESULT GetInfoFromPidl(LPCITEMIDLIST pcidl, const RegPidlEntry ** pentry); 108c2c66affSColin Finck 109c2c66affSColin Finck HRESULT FormatValueData(DWORD contentType, PVOID td, DWORD contentsLength, PCWSTR * strContents); 110c2c66affSColin Finck 111c2c66affSColin Finck HRESULT FormatContentsForDisplay(const RegPidlEntry * info, HKEY rootKey, LPCWSTR ntPath, PCWSTR * strContents); 112c2c66affSColin Finck }; 113