2011-05-15 15:55:49 +00:00
|
|
|
/*
|
|
|
|
* Virtual Desktop Folder
|
|
|
|
*
|
|
|
|
* Copyright 1997 Marcus Meissner
|
|
|
|
* Copyright 1998, 1999, 2002 Juergen Schmied
|
|
|
|
* Copyright 2009 Andrew Hill
|
|
|
|
*
|
|
|
|
* 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 _CDESKTOPFOLDER_H_
|
|
|
|
#define _CDESKTOPFOLDER_H_
|
|
|
|
|
|
|
|
class CDesktopFolder :
|
2011-12-18 21:54:04 +00:00
|
|
|
public CComCoClass<CDesktopFolder, &CLSID_ShellDesktop>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
|
|
|
public IShellFolder2,
|
2016-11-29 15:38:55 +00:00
|
|
|
public IPersistFolder2,
|
2020-02-12 00:18:24 +00:00
|
|
|
public IContextMenuCB,
|
|
|
|
public IItemNameLimits
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
2011-12-18 21:54:04 +00:00
|
|
|
private:
|
|
|
|
/* both paths are parsible from the desktop */
|
2016-05-03 13:47:16 +00:00
|
|
|
CComPtr<IShellFolder2> m_DesktopFSFolder;
|
|
|
|
CComPtr<IShellFolder2> m_SharedDesktopFSFolder;
|
2016-08-10 18:56:48 +00:00
|
|
|
CComPtr<IShellFolder2> m_regFolder;
|
2015-08-17 12:55:37 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */
|
|
|
|
LPITEMIDLIST pidlRoot; /* absolute pidl */
|
2015-06-20 16:54:52 +00:00
|
|
|
|
2016-05-03 13:47:16 +00:00
|
|
|
HRESULT _GetSFFromPidl(LPCITEMIDLIST pidl, IShellFolder2** psf);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2024-04-25 22:20:28 +00:00
|
|
|
static HRESULT GetColumnDetails(UINT iColumn, SHELLDETAILS &sd);
|
|
|
|
|
2024-04-13 12:08:39 +00:00
|
|
|
HRESULT _ParseDisplayNameByParent(
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPBC pbc,
|
|
|
|
LPOLESTR pszPath,
|
|
|
|
DWORD *pchEaten,
|
|
|
|
PIDLIST_RELATIVE *ppidl,
|
|
|
|
DWORD *pdwAttributes);
|
|
|
|
|
|
|
|
STDMETHODIMP
|
|
|
|
ShellUrlParseDisplayName(
|
|
|
|
HWND hwndOwner,
|
|
|
|
LPBC pbc,
|
|
|
|
LPOLESTR lpszDisplayName,
|
|
|
|
DWORD *pchEaten,
|
|
|
|
PIDLIST_RELATIVE *ppidl,
|
|
|
|
DWORD *pdwAttributes);
|
|
|
|
|
|
|
|
STDMETHODIMP
|
|
|
|
HttpUrlParseDisplayName(
|
[SHELL32][SDK] Fix ParseDisplayName Part 1 (#6721)
JIRA issue: CORE-19495
- Implement SHParseDisplayName and
CDesktopFolder::ParseDisplayName.
- Add CStubFolderBase, CShellUrlStub, CFileUrlStub,
CIDListUrlStub, and CHttpUrlStub helper classes.
- Add SHGetSpecialFolderID and
Shell_ParseSpecialFolder helper functions.
- Add BindCtx_ContainsObject,
BindCtx_GetUIWindow,
BindCtx_RegisterObjectParam, SHBindToObject,
SHBindToObjectEx, SHCoInitializeAnyApartment,
SHGetAttributes, SHGetNameAndFlagsW,
SHIsFileSysBindCtx, SHSkipJunctionBinding,
Shell_DisplayNameOf, and Shell_FailForceReturn
helper functions.
- Modify CSIDL data.
2024-04-10 00:32:13 +00:00
|
|
|
HWND hwndOwner,
|
2024-04-13 12:08:39 +00:00
|
|
|
LPBC pbc,
|
|
|
|
LPOLESTR lpszDisplayName,
|
[SHELL32][SDK] Fix ParseDisplayName Part 1 (#6721)
JIRA issue: CORE-19495
- Implement SHParseDisplayName and
CDesktopFolder::ParseDisplayName.
- Add CStubFolderBase, CShellUrlStub, CFileUrlStub,
CIDListUrlStub, and CHttpUrlStub helper classes.
- Add SHGetSpecialFolderID and
Shell_ParseSpecialFolder helper functions.
- Add BindCtx_ContainsObject,
BindCtx_GetUIWindow,
BindCtx_RegisterObjectParam, SHBindToObject,
SHBindToObjectEx, SHCoInitializeAnyApartment,
SHGetAttributes, SHGetNameAndFlagsW,
SHIsFileSysBindCtx, SHSkipJunctionBinding,
Shell_DisplayNameOf, and Shell_FailForceReturn
helper functions.
- Modify CSIDL data.
2024-04-10 00:32:13 +00:00
|
|
|
DWORD *pchEaten,
|
2024-04-13 12:08:39 +00:00
|
|
|
PIDLIST_RELATIVE *ppidl,
|
[SHELL32][SDK] Fix ParseDisplayName Part 1 (#6721)
JIRA issue: CORE-19495
- Implement SHParseDisplayName and
CDesktopFolder::ParseDisplayName.
- Add CStubFolderBase, CShellUrlStub, CFileUrlStub,
CIDListUrlStub, and CHttpUrlStub helper classes.
- Add SHGetSpecialFolderID and
Shell_ParseSpecialFolder helper functions.
- Add BindCtx_ContainsObject,
BindCtx_GetUIWindow,
BindCtx_RegisterObjectParam, SHBindToObject,
SHBindToObjectEx, SHCoInitializeAnyApartment,
SHGetAttributes, SHGetNameAndFlagsW,
SHIsFileSysBindCtx, SHSkipJunctionBinding,
Shell_DisplayNameOf, and Shell_FailForceReturn
helper functions.
- Modify CSIDL data.
2024-04-10 00:32:13 +00:00
|
|
|
DWORD *pdwAttributes);
|
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
public:
|
|
|
|
CDesktopFolder();
|
|
|
|
~CDesktopFolder();
|
|
|
|
HRESULT WINAPI FinalConstruct();
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// *** IShellFolder methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(ParseDisplayName)(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes) override;
|
|
|
|
STDMETHOD(EnumObjects)(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) override;
|
|
|
|
STDMETHOD(BindToObject)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
|
|
|
|
STDMETHOD(BindToStorage)(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut) override;
|
|
|
|
STDMETHOD(CompareIDs)(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2) override;
|
|
|
|
STDMETHOD(CreateViewObject)(HWND hwndOwner, REFIID riid, LPVOID *ppvOut) override;
|
|
|
|
STDMETHOD(GetAttributesOf)(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut) override;
|
|
|
|
STDMETHOD(GetUIObjectOf)(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) override;
|
|
|
|
STDMETHOD(GetDisplayNameOf)(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet) override;
|
|
|
|
STDMETHOD(SetNameOf)(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut) override;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// *** IShellFolder2 methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(GetDefaultSearchGUID)(GUID *pguid) override;
|
|
|
|
STDMETHOD(EnumSearches)(IEnumExtraSearch **ppenum) override;
|
|
|
|
STDMETHOD(GetDefaultColumn)(DWORD dwRes, ULONG *pSort, ULONG *pDisplay) override;
|
|
|
|
STDMETHOD(GetDefaultColumnState)(UINT iColumn, DWORD *pcsFlags) override;
|
|
|
|
STDMETHOD(GetDetailsEx)(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv) override;
|
|
|
|
STDMETHOD(GetDetailsOf)(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd) override;
|
|
|
|
STDMETHOD(MapColumnToSCID)(UINT column, SHCOLUMNID *pscid) override;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// *** IPersist methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(GetClassID)(CLSID *lpClassId) override;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// *** IPersistFolder methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidl) override;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
// *** IPersistFolder2 methods ***
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(GetCurFolder)(PIDLIST_ABSOLUTE * pidl) override;
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2016-11-29 15:38:55 +00:00
|
|
|
// IContextMenuCB
|
2024-03-04 23:43:39 +00:00
|
|
|
STDMETHOD(CallBack)(IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
2016-11-29 15:38:55 +00:00
|
|
|
|
2020-02-12 00:18:24 +00:00
|
|
|
/*** IItemNameLimits methods ***/
|
|
|
|
|
|
|
|
STDMETHODIMP
|
2024-03-04 23:43:39 +00:00
|
|
|
GetMaxLength(LPCWSTR pszName, int *piMaxNameLen) override
|
2020-02-12 00:18:24 +00:00
|
|
|
{
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
STDMETHODIMP
|
2024-03-04 23:43:39 +00:00
|
|
|
GetValidCharacters(LPWSTR *ppwszValidChars, LPWSTR *ppwszInvalidChars) override
|
2020-02-12 00:18:24 +00:00
|
|
|
{
|
|
|
|
if (ppwszValidChars)
|
|
|
|
{
|
|
|
|
*ppwszValidChars = NULL;
|
|
|
|
}
|
|
|
|
if (ppwszInvalidChars)
|
|
|
|
{
|
|
|
|
SHStrDupW(INVALID_FILETITLE_CHARACTERSW, ppwszInvalidChars);
|
|
|
|
}
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_SHELLDESKTOP)
|
2015-06-20 21:46:16 +00:00
|
|
|
DECLARE_CENTRAL_INSTANCE_NOT_AGGREGATABLE(CDesktopFolder)
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2011-12-18 21:54:04 +00:00
|
|
|
BEGIN_COM_MAP(CDesktopFolder)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellFolder2, IShellFolder2)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IShellFolder, IShellFolder)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
|
2020-02-12 00:18:24 +00:00
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IItemNameLimits, IItemNameLimits)
|
2011-12-18 21:54:04 +00:00
|
|
|
END_COM_MAP()
|
2011-05-15 15:55:49 +00:00
|
|
|
};
|
|
|
|
|
2014-01-25 17:24:24 +00:00
|
|
|
#endif /* _CDESKTOPFOLDER_H_ */
|