2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
/*
|
2014-03-15 13:59:22 +00:00
|
|
|
* Virtual Folder
|
|
|
|
* common definitions
|
2011-05-15 15:55:49 +00:00
|
|
|
*
|
2014-03-15 13:59:22 +00:00
|
|
|
* Copyright 1997 Marcus Meissner
|
|
|
|
* Copyright 1998, 1999, 2002 Juergen Schmied
|
2011-05-15 15:55:49 +00:00
|
|
|
*
|
|
|
|
* 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 _SHFLDR_H_
|
|
|
|
#define _SHFLDR_H_
|
|
|
|
|
|
|
|
#define CHARS_IN_GUID 39
|
|
|
|
|
|
|
|
typedef struct {
|
2024-04-25 22:20:28 +00:00
|
|
|
WORD colnameid; // Column title text resource id passed to LoadString
|
|
|
|
WORD colstate; // SHCOLSTATEF returned by IShellFolder2::GetDefaultColumnState
|
|
|
|
// HACK: SHCOLSTATEF truncated to WORD to reduce .rdata section size
|
|
|
|
WORD fmt; // LVCFMT_*
|
|
|
|
WORD cxChar; // Column width hint
|
2011-05-15 15:55:49 +00:00
|
|
|
} shvheader;
|
2024-04-25 22:20:28 +00:00
|
|
|
/*
|
|
|
|
* CFSFolder column indices. CDesktopFolder MUST use the same indices!
|
|
|
|
* According to the documentation for IShellFolder2::GetDetailsOf,
|
|
|
|
* the first 4 columns for SFGAO_FILESYSTEM items must be Name, Size, Type, Modified date
|
|
|
|
For Details See:
|
|
|
|
https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishellfolder2-getdetailsof
|
|
|
|
*/
|
|
|
|
#define SHFSF_COL_NAME 0
|
|
|
|
#define SHFSF_COL_SIZE 1
|
|
|
|
#define SHFSF_COL_TYPE 2 // SHGFI_TYPENAME
|
|
|
|
#define SHFSF_COL_MDATE 3 // Modified date
|
|
|
|
#define SHFSF_COL_FATTS 4 // File attributes
|
|
|
|
#define SHFSF_COL_COMMENT 5
|
2011-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
#define GET_SHGDN_FOR(dwFlags) ((DWORD)dwFlags & (DWORD)0x0000FF00)
|
|
|
|
#define GET_SHGDN_RELATION(dwFlags) ((DWORD)dwFlags & (DWORD)0x000000FF)
|
|
|
|
|
2024-04-13 12:07:12 +00:00
|
|
|
HRESULT
|
|
|
|
Shell_NextElement(
|
|
|
|
_Inout_ LPWSTR *ppch,
|
|
|
|
_Out_ LPWSTR pszOut,
|
|
|
|
_In_ INT cchOut,
|
|
|
|
_In_ BOOL bValidate);
|
|
|
|
|
2011-05-15 15:55:49 +00:00
|
|
|
HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut,
|
2014-03-15 13:59:22 +00:00
|
|
|
LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes);
|
2015-09-22 18:11:32 +00:00
|
|
|
|
2015-08-31 11:28:24 +00:00
|
|
|
HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2015-08-17 11:36:56 +00:00
|
|
|
HRESULT SHELL32_GetFSItemAttributes(IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes);
|
|
|
|
|
2015-10-26 15:07:44 +00:00
|
|
|
HRESULT SHELL32_CompareDetails(IShellFolder2* isf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
|
|
|
|
2016-11-04 23:11:29 +00:00
|
|
|
HRESULT SHELL32_CompareChildren(IShellFolder2* psf, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
|
|
|
|
|
2017-07-07 20:34:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
|
|
|
|
LPCITEMIDLIST pidlChild, const GUID* clsid, REFIID riid, LPVOID *ppvOut);
|
|
|
|
|
|
|
|
HRESULT SHELL32_CoCreateInitSF (LPCITEMIDLIST pidlRoot, const GUID* clsid,
|
|
|
|
int csidl, REFIID riid, LPVOID *ppvOut);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
HRESULT SHELL32_BindToSF (LPCITEMIDLIST pidlRoot, PERSIST_FOLDER_TARGET_INFO* ppfti,
|
|
|
|
LPCITEMIDLIST pidl, const GUID* clsid, REFIID riid, LPVOID *ppvOut);
|
2021-09-13 01:33:14 +00:00
|
|
|
|
2015-08-17 11:36:56 +00:00
|
|
|
extern "C"
|
|
|
|
BOOL HCR_RegOpenClassIDKey(REFIID riid, HKEY *hkey);
|
|
|
|
|
2024-03-24 20:37:59 +00:00
|
|
|
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY* array, UINT* cKeys);
|
2016-11-15 20:14:56 +00:00
|
|
|
|
2016-11-29 15:38:55 +00:00
|
|
|
HRESULT CDefViewBckgrndMenu_CreateInstance(IShellFolder* psf, REFIID riid, void **ppv);
|
|
|
|
|
2016-11-17 14:35:19 +00:00
|
|
|
HRESULT SH_GetApidlFromDataObject(IDataObject *pDataObject, PIDLIST_ABSOLUTE* ppidlfolder, PUITEMID_CHILD **apidlItems, UINT *pcidl);
|
|
|
|
|
2014-11-03 12:10:23 +00:00
|
|
|
static __inline int SHELL32_GUIDToStringA (REFGUID guid, LPSTR str)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
2024-04-07 11:34:50 +00:00
|
|
|
return sprintf(str, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
|
2011-05-15 15:55:49 +00:00
|
|
|
guid.Data1, guid.Data2, guid.Data3,
|
|
|
|
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
|
|
|
|
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
|
|
|
|
}
|
|
|
|
|
2014-11-03 12:10:23 +00:00
|
|
|
static __inline int SHELL32_GUIDToStringW (REFGUID guid, LPWSTR str)
|
2011-05-15 15:55:49 +00:00
|
|
|
{
|
|
|
|
static const WCHAR fmtW[] =
|
2024-04-07 11:34:50 +00:00
|
|
|
{ '{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-',
|
|
|
|
'%','0','2','X','%','0','2','X','-',
|
|
|
|
'%','0','2','X','%','0','2','X','%','0','2','X','%','0','2','X',
|
|
|
|
'%','0','2','X','%','0','2','X','}',0 };
|
2011-05-15 15:55:49 +00:00
|
|
|
return swprintf(str, fmtW,
|
|
|
|
guid.Data1, guid.Data2, guid.Data3,
|
|
|
|
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
|
|
|
|
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags);
|
2021-10-11 04:33:43 +00:00
|
|
|
BOOL SHELL_FS_HideExtension(LPCWSTR pwszPath);
|
2011-05-15 15:55:49 +00:00
|
|
|
|
2024-03-24 20:37:59 +00:00
|
|
|
LSTATUS AddClassKeyToArray(const WCHAR* szClass, HKEY* array, UINT* cKeys);
|
2016-10-02 13:22:01 +00:00
|
|
|
|
2016-04-30 14:05:10 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
|
|
HRESULT inline SHSetStrRet(LPSTRRET pStrRet, DWORD resId)
|
|
|
|
{
|
|
|
|
return SHSetStrRet(pStrRet, shell32_hInstance, resId);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2014-01-25 17:24:24 +00:00
|
|
|
#endif /* _SHFLDR_H_ */
|