ReactOS 0.4.16-dev-1020-gf135cab
item_prop.cpp File Reference
#include "precomp.h"
Include dependency graph for item_prop.cpp:

Go to the source code of this file.

Classes

struct  ShellPropSheetDialog
 
struct  ShellPropSheetDialog::DATA
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static HRESULT SHELL_GetCaptionFromDataObject (IDataObject *pDO, LPWSTR Buf, UINT cchBuf)
 
static void CALLBACK FSFolderItemPropDialogInitCallback (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
 
static void CALLBACK ClassPropDialogInitCallback (LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
 
HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync (IDataObject *pDO)
 
HRESULT SHELL32_ShowFilesystemItemsPropertiesDialogAsync (HWND hOwner, IDataObject *pDO)
 
HRESULT SHELL32_ShowShellExtensionProperties (const CLSID *pClsid, IDataObject *pDO)
 
HRESULT SHELL_ShowItemIDListProperties (LPCITEMIDLIST pidl)
 

Function Documentation

◆ ClassPropDialogInitCallback()

static void CALLBACK ClassPropDialogInitCallback ( LPCWSTR  InitString,
IDataObject pDO,
HKEY hKeys,
UINT cKeys 
)
static

Definition at line 150 of file item_prop.cpp.

151{
153 AddClassKeyToArray(InitString, hKeys, cKeys); // Add pages from HKCR\%ProgId% (with shellex\PropertySheetHandlers appended later)
154}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:323

Referenced by SHELL32_ShowFilesystemItemPropertiesDialogAsync(), and SHELL32_ShowShellExtensionProperties().

◆ FSFolderItemPropDialogInitCallback()

static void CALLBACK FSFolderItemPropDialogInitCallback ( LPCWSTR  InitString,
IDataObject pDO,
HKEY hKeys,
UINT cKeys 
)
static

Definition at line 130 of file item_prop.cpp.

131{
132 UNREFERENCED_PARAMETER(InitString);
133 CDataObjectHIDA cida(pDO);
134 if (SUCCEEDED(cida.hr()) && cida->cidl)
135 {
136#if 0
137 CCidaChildArrayHelper items(cida);
138 if (FAILED(hr = items.hr()))
139 return hr;
140#else
141 // Note: Since we are only passing a single item to AddFSClassKeysToArray,
142 // we don't need the rest of the array to be valid.
143 PCUITEMID_CHILD pidl = HIDA_GetPIDLItem(cida, 0);
144#endif
145 AddFSClassKeysToArray(1, &pidl, hKeys, cKeys); // Add file-type specific pages
146 }
147}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
static TCHAR * items[]
Definition: page1.c:45
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:641
void AddFSClassKeysToArray(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, HKEY *array, UINT *cKeys)
Definition: shlfolder.cpp:345
HRESULT hr
Definition: shlfolder.c:183
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70

Referenced by SHELL32_ShowFilesystemItemPropertiesDialogAsync().

◆ SHELL32_ShowFilesystemItemPropertiesDialogAsync()

HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync ( IDataObject pDO)

Definition at line 157 of file item_prop.cpp.

158{
159 CDataObjectHIDA cida(pDO);
160 HRESULT hr = cida.hr();
162 return hr;
163
164 const CLSID *pClsid = NULL;
166 LPCWSTR InitString = NULL;
167
168 if (cida->cidl && _ILIsDrive(HIDA_GetPIDLItem(cida, 0)))
169 {
170 pClsid = &CLSID_ShellDrvDefExt;
172 InitString = L"Drive";
173 }
174 else
175 {
176 pClsid = &CLSID_ShellFileDefExt;
178 }
180 return Dialog.ShowAsync(pClsid, pDO, InitFunc, InitString);
181}
#define NULL
Definition: types.h:112
#define FAILED_UNEXPECTEDLY(hr)
Definition: debug.h:83
static void CALLBACK FSFolderItemPropDialogInitCallback(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:130
static void CALLBACK ClassPropDialogInitCallback(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:150
#define L(x)
Definition: ntvdm.h:50
BOOL _ILIsDrive(LPCITEMIDLIST pidl)
Definition: pidl.c:2095
Definition: window.h:372
void(CALLBACK * PFNINITIALIZE)(LPCWSTR InitString, IDataObject *pDO, HKEY *hKeys, UINT *cKeys)
Definition: item_prop.cpp:29
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by DrivesContextMenuCallback(), and SHELL32_ShowFilesystemItemsPropertiesDialogAsync().

◆ SHELL32_ShowFilesystemItemsPropertiesDialogAsync()

HRESULT SHELL32_ShowFilesystemItemsPropertiesDialogAsync ( HWND  hOwner,
IDataObject pDO 
)

Definition at line 184 of file item_prop.cpp.

185{
186 if (DataObject_GetHIDACount(pDO) == 1)
188
189 ERR("SHMultiFileProperties is not implemented yet\n");
191 SHELL_ErrorBox(hOwner, hr);
192 return hr; // TODO: return SHMultiFileProperties(pDO, 0);
193}
#define ERR(fmt,...)
Definition: precomp.h:57
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
HRESULT DataObject_GetHIDACount(IDataObject *pdo)
HRESULT SHELL32_ShowFilesystemItemPropertiesDialogAsync(IDataObject *pDO)
Definition: item_prop.cpp:157
#define SHELL_ErrorBox
Definition: shellutils.h:126
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by SHELL32_ShowPropertiesDialog().

◆ SHELL32_ShowShellExtensionProperties()

HRESULT SHELL32_ShowShellExtensionProperties ( const CLSID pClsid,
IDataObject pDO 
)

Definition at line 196 of file item_prop.cpp.

197{
198 WCHAR ClassBuf[6 + 38 + 1] = L"CLSID\\";
199 StringFromGUID2(*pClsid, ClassBuf + 6, 38 + 1);
201 return Dialog.ShowAsync(NULL, pDO, ClassPropDialogInitCallback, ClassBuf);
202}
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RegFolderContextMenuCallback().

◆ SHELL_GetCaptionFromDataObject()

static HRESULT SHELL_GetCaptionFromDataObject ( IDataObject pDO,
LPWSTR  Buf,
UINT  cchBuf 
)
static

Definition at line 13 of file item_prop.cpp.

14{
17 {
18 hr = SHGetNameAndFlagsW(pidl, SHGDN_INFOLDER, Buf, cchBuf, NULL);
19 ILFree(pidl);
20
21 if (SUCCEEDED(hr) && DataObject_GetHIDACount(pDO) > 1)
22 StringCchCatW(Buf, cchBuf, L", ...");
23 }
24 return hr;
25}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT SHGetNameAndFlagsW(_In_ LPCITEMIDLIST pidl, _In_ DWORD dwFlags, _Out_opt_ LPWSTR pszText, _In_ UINT cchBuf, _Inout_opt_ DWORD *pdwAttributes)
Definition: utils.cpp:480
PIDLIST_ABSOLUTE SHELL_DataObject_ILCloneFullItem(_In_ IDataObject *pDO, _In_ UINT Index)
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:1044
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325

Referenced by ShellPropSheetDialog::Show().

◆ SHELL_ShowItemIDListProperties()

HRESULT SHELL_ShowItemIDListProperties ( LPCITEMIDLIST  pidl)

Definition at line 205 of file item_prop.cpp.

206{
207 assert(pidl);
208
209 CComHeapPtr<ITEMIDLIST> alloc;
210 if (IS_INTRESOURCE(pidl))
211 {
212 HRESULT hr = SHGetSpecialFolderLocation(NULL, LOWORD(pidl), const_cast<LPITEMIDLIST*>(&pidl));
213 if (FAILED(hr))
214 return hr;
215 alloc.Attach(const_cast<LPITEMIDLIST>(pidl));
216 }
217 SHELLEXECUTEINFOA sei = {
218 sizeof(sei), SEE_MASK_INVOKEIDLIST | SEE_MASK_ASYNCOK, NULL, "properties",
219 NULL, NULL, NULL, SW_SHOWNORMAL, NULL, const_cast<LPITEMIDLIST>(pidl)
220 };
222}
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3408
#define assert(x)
Definition: debug.h:53
#define S_OK
Definition: intsafe.h:52
#define HResultFromWin32
Definition: loader.cpp:14
#define LOWORD(l)
Definition: pedump.c:82
#define alloc
Definition: rosglue.h:13
#define SEE_MASK_ASYNCOK
Definition: shellapi.h:54
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExA(LPSHELLEXECUTEINFOA sei)
Definition: shlexec.cpp:2394
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

Referenced by CFSFolder::CallBack(), and CRecycleBin::InvokeCommand().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )