- Pass IDataObject to the folder shell extension init function

- Fixes displaying property sheet handler extension for directories such as TortoiseSVN

svn path=/trunk/; revision=40828
This commit is contained in:
Johannes Anderwald 2009-05-07 18:05:29 +00:00
parent dbc07fc66b
commit 20f87008f7
3 changed files with 22 additions and 10 deletions

View file

@ -83,6 +83,7 @@ static FOLDER_VIEW_ENTRY s_Options[] =
};
*/
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
INT_PTR
CALLBACK
@ -562,15 +563,16 @@ FolderAddPropSheetPageProc(HPROPSHEETPAGE hpage, LPARAM lParam)
}
BOOL
SH_ShowFolderProperties(LPWSTR pwszFolder)
SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl)
{
HPROPSHEETPAGE hppages[MAX_PROPERTY_SHEET_PAGE];
HPROPSHEETPAGE hpage;
PROPSHEETHEADERW psh;
BOOL ret;
WCHAR szName[MAX_PATH] = {0};
HPSXA hpsx;
HPSXA hpsx = NULL;
LPWSTR pFolderName;
IDataObject * pDataObj = NULL;
if (!PathIsDirectoryW(pwszFolder))
return FALSE;
@ -594,15 +596,25 @@ SH_ShowFolderProperties(LPWSTR pwszFolder)
psh.u3.phpage = hppages;
psh.pszCaption = szName;
hpsx = SHCreatePropSheetExtArray(HKEY_CLASSES_ROOT,
L"Directory",
MAX_PROPERTY_SHEET_PAGE-1);
SHAddFromPropSheetExtArray(hpsx,
(LPFNADDPROPSHEETPAGE)FolderAddPropSheetPageProc,
(LPARAM)&psh);
if (SHCreateDataObject(pidlFolder, 1, apidl, NULL, &IID_IDataObject, (void**)&pDataObj) == S_OK)
{
hpsx = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, L"Directory", MAX_PROPERTY_SHEET_PAGE-1, pDataObj);
if (hpsx)
{
SHAddFromPropSheetExtArray(hpsx,
(LPFNADDPROPSHEETPAGE)FolderAddPropSheetPageProc,
(LPARAM)&psh);
}
}
ret = PropertySheetW(&psh);
if (pDataObj)
IDataObject_Release(pDataObj);
if (hpsx)
SHDestroyPropSheetExtArray(hpsx);
if (ret < 0)
return FALSE;
else

View file

@ -807,7 +807,7 @@ SH_ShowPropertiesDialog(WCHAR *lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *api
if (PathIsDirectoryW(wFileName))
{
return SH_ShowFolderProperties(wFileName);
return SH_ShowFolderProperties(wFileName, pidlFolder, apidl);
}
if (wcslen(wFileName) == 3)

View file

@ -235,5 +235,5 @@ HPROPSHEETPAGE SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM
BOOL SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl);
BOOL SH_ShowRecycleBinProperties(WCHAR sDrive);
BOOL SH_ShowPropertiesDialog(LPWSTR lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl);
BOOL SH_ShowFolderProperties(LPWSTR pwszFolder);
BOOL SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * apidl);
#endif