ReactOS 0.4.16-dev-197-g92996da
CControlPanelFolder.h
Go to the documentation of this file.
1/*
2 * Control panel folder
3 *
4 * Copyright 2003 Martin Fuchs
5 * Copyright 2009 Andrew Hill
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#ifndef _SHFLDR_CPANEL_H_
23#define _SHFLDR_CPANEL_H_
24
26 public CComCoClass<CControlPanelFolder, &CLSID_ControlPanel>,
27 public CComObjectRootEx<CComMultiThreadModelNoCS>,
28 public IShellFolder2,
29 public IPersistFolder2
30{
31 private:
32 /* both paths are parsible from the desktop */
33 LPITEMIDLIST pidlRoot; /* absolute pidl */
34 int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
35 CComPtr<IShellFolder2> m_regFolder;
36
38
39 public:
42
43 // IShellFolder
44 STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override;
45 STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
46 STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
47 STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
49 STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
50 STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
51 STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
53 STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
54
55 /* ShellFolder2 */
56 STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
57 STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
58 STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
59 STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
60 STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
61 STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
63
64 // IPersist
65 STDMETHOD(GetClassID)(CLSID *lpClassId) override;
66
67 // IPersistFolder
69
70 // IPersistFolder2
71 STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override;
72
75
77
79 COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
80 COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
81 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
82 COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
85};
86
88 public CComObjectRootEx<CComMultiThreadModelNoCS>,
89 public IContextMenu2
90{
91private:
94
95public:
99
100 // IContextMenu
101 STDMETHOD(QueryContextMenu)(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override;
102 STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpcmi) override;
103 STDMETHOD(GetCommandString)(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override;
104
105 // IContextMenu2
106 STDMETHOD(HandleMenuMsg)(UINT uMsg, WPARAM wParam, LPARAM lParam) override;
107
109 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
110 COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2)
112};
113
115 public CComCoClass<COpenControlPanel, &CLSID_OpenControlPanel>,
116 public CComObjectRootEx<CComMultiThreadModelNoCS>,
117 public IOpenControlPanel
118{
119 public:
120 // IOpenControlPanel
121 STDMETHOD(Open)(LPCWSTR pszName, LPCWSTR pszPage, IUnknown *punkSite) override;
122 STDMETHOD(GetPath)(LPCWSTR pszName, LPWSTR pszPath, UINT cchPath) override;
123 STDMETHOD(GetCurrentView)(CPVIEW *pView) override;
124
125 static HRESULT WINAPI UpdateRegistry(BOOL bRegister) { return S_OK; } // CControlPanelFolder does it for us
127
129
131 COM_INTERFACE_ENTRY_IID(IID_IOpenControlPanel, IOpenControlPanel)
133};
134
135#endif /* _SHFLDR_CPANEL_H_ */
const WCHAR * class
Definition: main.c:68
#define STDMETHOD(m)
Definition: basetyps.h:62
PITEMID_CHILD * m_apidl
STDMETHOD() GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override
STDMETHOD() GetCurFolder(PIDLIST_ABSOLUTE *pidl) override
CComPtr< IShellFolder2 > m_regFolder
STDMETHOD() MapColumnToSCID(UINT column, SHCOLUMNID *pscid) override
STDMETHOD() GetDefaultColumn(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override
STDMETHOD() GetDefaultColumnState(UINT iColumn, DWORD *pcsFlags) override
STDMETHOD() GetDefaultSearchGUID(GUID *pguid) override
STDMETHOD() GetClassID(CLSID *lpClassId) override
STDMETHOD() CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override
STDMETHOD() CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override
HRESULT WINAPI ExecuteFromIdList(LPCITEMIDLIST pidl)
STDMETHOD() GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override
STDMETHOD() GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override
STDMETHOD() BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() EnumSearches(IEnumExtraSearch **ppenum) override
STDMETHOD() EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override
STDMETHOD() GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override
STDMETHOD() BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override
STDMETHOD() GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut) override
STDMETHOD() SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override
static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
UINT uFlags
Definition: api.c:59
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:581
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:601
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:679
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:651
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:645
#define END_COM_MAP()
Definition: atlcom.h:592
#define Open
Definition: syshdrs.h:62
static IParseDisplayName ParseDisplayName
Definition: moniker.c:816
static LPOLESTR
Definition: stg_prop.c:27
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
interface IBindCtx * LPBC
Definition: objfwd.h:18
const GUID IID_IPersist
Definition: proxy.cpp:14
#define REFIID
Definition: guiddef.h:118
static HRESULT GetCommandString(IContextMenu &CM, UINT Id, UINT Type, LPWSTR buf, UINT cchMax)
Definition: shlextdbg.cpp:175
#define IDR_CONTROLPANEL
Definition: shresdef.h:885
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
uint32_t ULONG
Definition: typedefs.h:59
_In_ LPCSTR lpName
Definition: winbase.h:2813
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
int WINAPI GetPath(_In_ HDC hdc, _Out_writes_opt_(cpt) LPPOINT apt, _Out_writes_opt_(cpt) LPBYTE aj, int cpt)
static void Initialize()
Definition: xlate.c:212
char * LPSTR
Definition: xmlstorage.h:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185