mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 08:00:24 +00:00
- Fix indentation.
- Fix bug #3920 (at line 736). svn path=/trunk/; revision=38455
This commit is contained in:
parent
ed14235592
commit
5341c63e40
1 changed files with 358 additions and 288 deletions
|
@ -31,6 +31,7 @@ typedef struct _LANGANDCODEPAGE_
|
|||
} LANGANDCODEPAGE, *LPLANGANDCODEPAGE;
|
||||
|
||||
HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj);
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* SH_CreatePropertySheetPage [Internal]
|
||||
|
@ -38,6 +39,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_
|
|||
* creates a property sheet page from an resource name
|
||||
*
|
||||
*/
|
||||
|
||||
HPROPSHEETPAGE
|
||||
SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
|
||||
{
|
||||
|
@ -55,7 +57,9 @@ SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR
|
|||
ERR("failed to find resource name\n");
|
||||
return (HPROPSHEETPAGE)0;
|
||||
}
|
||||
|
||||
lpsztemplate = LoadResource(shell32_hInstance, hRes);
|
||||
|
||||
if (lpsztemplate == NULL)
|
||||
return (HPROPSHEETPAGE)0;
|
||||
|
||||
|
@ -66,19 +70,15 @@ SH_CreatePropertySheetPage(LPSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR
|
|||
ppage.pfnDlgProc = dlgproc;
|
||||
ppage.lParam = lParam;
|
||||
ppage.pszTitle = szTitle;
|
||||
|
||||
if (szTitle)
|
||||
{
|
||||
ppage.dwFlags |= PSP_USETITLE;
|
||||
}
|
||||
|
||||
return CreatePropertySheetPageW(&ppage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* SH_FileGeneralFileType [Internal]
|
||||
|
@ -96,7 +96,6 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
WCHAR value[MAX_PATH];
|
||||
DWORD lname = MAX_PATH;
|
||||
DWORD lvalue = MAX_PATH;
|
||||
|
||||
HKEY hKey;
|
||||
LONG result;
|
||||
HWND hDlgCtrl;
|
||||
|
@ -119,11 +118,13 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)name);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
result = RegEnumValueW(hKey, 0, name, &lname, NULL, NULL, (LPBYTE)value, &lvalue);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
if (result != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
if (RegOpenKeyW(HKEY_CLASSES_ROOT, value, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegLoadMUIStringW(hKey, L"FriendlyTypeName", value, MAX_PATH, NULL, 0, NULL) != ERROR_SUCCESS)
|
||||
|
@ -131,7 +132,9 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
lvalue = lname = MAX_PATH;
|
||||
result = RegEnumValueW(hKey, 0, name, &lname, NULL, NULL, (LPBYTE)value, &lvalue);
|
||||
}
|
||||
|
||||
lname = MAX_PATH;
|
||||
|
||||
if (RegGetValueW(hKey, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, name, &lname) == ERROR_SUCCESS)
|
||||
{
|
||||
UINT IconIndex;
|
||||
|
@ -143,11 +146,13 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
HGLOBAL hGlobal;
|
||||
HANDLE hLibrary;
|
||||
Offset = wcsrchr(name, L',');
|
||||
|
||||
if (Offset)
|
||||
{
|
||||
IconIndex = _wtoi(Offset + 2);
|
||||
*Offset = L'\0';
|
||||
name[MAX_PATH - 1] = L'\0';
|
||||
|
||||
if (ExpandEnvironmentStringsW(name, szBuffer, MAX_PATH))
|
||||
{
|
||||
szBuffer[MAX_PATH - 1] = L'\0';
|
||||
|
@ -164,7 +169,13 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
if (pResource != NULL)
|
||||
{
|
||||
hIcon = CreateIconFromResource(pResource, SizeofResource(shell32_hInstance, hResource), TRUE, 0x00030000);
|
||||
TRACE("hIcon %p,- szBuffer %s IconIndex %u error %u icon %p hResource %p pResource %p\n", hIcon, debugstr_w(szBuffer), IconIndex, MAKEINTRESOURCEW(IconIndex), hResource, pResource);
|
||||
TRACE("hIcon %p,- szBuffer %s IconIndex %u error %u icon %p hResource %p pResource %p\n",
|
||||
hIcon,
|
||||
debugstr_w(szBuffer),
|
||||
IconIndex,
|
||||
MAKEINTRESOURCEW(IconIndex),
|
||||
hResource,
|
||||
pResource);
|
||||
SendDlgItemMessageW(hwndDlg, 14000, STM_SETICON, (WPARAM)hIcon, 0);
|
||||
}
|
||||
}
|
||||
|
@ -180,8 +191,10 @@ SH_FileGeneralSetFileType(HWND hwndDlg, WCHAR * filext)
|
|||
/* file extension type */
|
||||
value[MAX_PATH - 1] = L'\0';
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)value);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* SHFileGeneralGetFileTimeString [Internal]
|
||||
|
@ -195,7 +208,9 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult)
|
|||
FILETIME ft;
|
||||
SYSTEMTIME dt;
|
||||
WORD wYear;
|
||||
static const WCHAR wFormat[] = {'%','0','2','d','/','%','0','2','d','/','%','0','4','d',' ',' ','%','0','2','d',':','%','0','2','u',0};
|
||||
static const WCHAR wFormat[] = {
|
||||
'%', '0', '2', 'd', '/', '%', '0', '2', 'd', '/', '%', '0', '4', 'd',
|
||||
' ', ' ', '%', '0', '2', 'd', ':', '%', '0', '2', 'u', 0 };
|
||||
|
||||
if (lpFileTime == NULL || lpResult == NULL)
|
||||
return FALSE;
|
||||
|
@ -206,6 +221,7 @@ SHFileGeneralGetFileTimeString(LPFILETIME lpFileTime, WCHAR * lpResult)
|
|||
FileTimeToSystemTime(&ft, &dt);
|
||||
|
||||
wYear = dt.wYear;
|
||||
|
||||
/* ddmmyy */
|
||||
swprintf(lpResult, wFormat, dt.wDay, dt.wMonth, wYear, dt.wHour, dt.wMinute);
|
||||
|
||||
|
@ -283,7 +299,8 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER
|
|||
|
||||
hFile = CreateFileW(lpfilename,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,NULL,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
|
@ -301,6 +318,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER
|
|||
WARN("GetFileTime failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (SHFileGeneralGetFileTimeString(&create_time, resultstr))
|
||||
{
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14015);
|
||||
|
@ -325,10 +343,16 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR * lpfilename, PULARGE_INTEGER
|
|||
CloseHandle(hFile);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
if (!StrFormatByteSizeW(file_size.QuadPart, resultstr, sizeof(resultstr) / sizeof(WCHAR)))
|
||||
|
||||
if (!StrFormatByteSizeW(file_size.QuadPart,
|
||||
resultstr,
|
||||
sizeof(resultstr) / sizeof(WCHAR)))
|
||||
return FALSE;
|
||||
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14011);
|
||||
|
||||
TRACE("result size %u resultstr %s\n", file_size.QuadPart, debugstr_w(resultstr));
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr);
|
||||
|
||||
|
@ -362,6 +386,7 @@ SH_FileVersionQuerySetText(HWND hwndDlg, DWORD dlgId, LPVOID pInfo, WCHAR * text
|
|||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)0, (LPARAM)*resptr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -373,15 +398,15 @@ SH_FileVersionQuerySetText(HWND hwndDlg, DWORD dlgId, LPVOID pInfo, WCHAR * text
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
BOOL
|
||||
SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR *text, WCHAR **resptr, WORD lang, WORD code)
|
||||
{
|
||||
UINT reslen;
|
||||
HWND hDlgCtrl;
|
||||
UINT index;
|
||||
static const WCHAR wFormat[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n',
|
||||
'f','o','\\','%','0','4','x','%','0','4','x','\\','%','s',0 };
|
||||
static const WCHAR wFormat[] = {
|
||||
'\\', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'l', 'e', 'I', 'n', 'f', 'o',
|
||||
'\\', '%', '0', '4', 'x', '%', '0', '4', 'x', '\\', '%', 's', 0 };
|
||||
WCHAR buff[256];
|
||||
|
||||
TRACE("text %s, resptr %p hwndDlg %p\n", debugstr_w(text), resptr, hwndDlg);
|
||||
|
@ -390,6 +415,7 @@ SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, W
|
|||
return FALSE;
|
||||
|
||||
swprintf(buff, wFormat, lang, code, text);
|
||||
|
||||
if (VerQueryValueW(pInfo, buff, (LPVOID *)resptr, &reslen))
|
||||
{
|
||||
/* listbox name property */
|
||||
|
@ -399,6 +425,7 @@ SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, W
|
|||
SendMessageW(hDlgCtrl, LB_SETITEMDATA, (WPARAM)index, (LPARAM)(WCHAR *)*resptr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -408,6 +435,7 @@ SH_FileVersionQuerySetListText(HWND hwndDlg, LPVOID pInfo, const WCHAR * text, W
|
|||
*
|
||||
* sets all file version properties in dialog
|
||||
*/
|
||||
|
||||
BOOL
|
||||
SH_FileVersionInitialize(HWND hwndDlg, WCHAR *lpfilename)
|
||||
{
|
||||
|
@ -422,21 +450,33 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
WORD code = 0;
|
||||
LPLANGANDCODEPAGE lplangcode;
|
||||
WCHAR *str;
|
||||
static const WCHAR wVersionFormat[] = { '%','d','.','%','d','.','%','d','.','%','d',0 };
|
||||
static const WCHAR wFileDescriptionFormat[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
|
||||
'\\','%','0','4','x','%','0','4','x','\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0 };
|
||||
static const WCHAR wLegalCopyrightFormat[] = { '\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o',
|
||||
'\\','%','0','4','x','%','0','4','x','\\','L','e','g','a','l','C','o','p','y','r','i','g','h','t',0 };
|
||||
static const WCHAR wTranslation[] = { 'V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0 };
|
||||
static const WCHAR wCompanyName[] = { 'C','o','m','p','a','n','y','N','a','m','e',0 };
|
||||
static const WCHAR wFileVersion[] = { 'F','i','l','e','V','e','r','s','i','o','n',0 };
|
||||
static const WCHAR wInternalName[] = { 'I','n','t','e','r','n','a','l','N','a','m','e',0 };
|
||||
static const WCHAR wOriginalFilename[] = { 'O','r','i','g','i','n','a','l','F','i','l','e','n','a','m','e',0 };
|
||||
static const WCHAR wProductName[] = { 'P','r','o','d','u','c','t','N','a','m','e',0 };
|
||||
static const WCHAR wProductVersion[] = { 'P','r','o','d','u','c','t','V','e','r','s','i','o','n',0 };
|
||||
static const WCHAR wVersionFormat[] = {
|
||||
'%', 'd', '.', '%', 'd', '.', '%', 'd', '.', '%', 'd', 0 };
|
||||
static const WCHAR wFileDescriptionFormat[] = {
|
||||
'\\', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'l', 'e', 'I', 'n', 'f', 'o',
|
||||
'\\', '%', '0', '4', 'x', '%', '0', '4', 'x',
|
||||
'\\', 'F', 'i', 'l', 'e', 'D', 'e', 's', 'c', 'r', 'i', 'p', 't', 'i', 'o', 'n', 0 };
|
||||
static const WCHAR wLegalCopyrightFormat[] = {
|
||||
'\\', 'S', 't', 'r', 'i', 'n', 'g', 'F', 'i', 'l', 'e', 'I', 'n', 'f', 'o',
|
||||
'\\', '%', '0', '4', 'x', '%', '0', '4', 'x',
|
||||
'\\', 'L', 'e', 'g', 'a', 'l', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', 0 };
|
||||
static const WCHAR wTranslation[] = {
|
||||
'V', 'a', 'r', 'F', 'i', 'l', 'e', 'I', 'n', 'f', 'o',
|
||||
'\\', 'T', 'r', 'a', 'n', 's', 'l', 'a', 't', 'i', 'o', 'n', 0 };
|
||||
static const WCHAR wCompanyName[] = {
|
||||
'C', 'o', 'm', 'p', 'a', 'n', 'y', 'N', 'a', 'm', 'e', 0 };
|
||||
static const WCHAR wFileVersion[] = {
|
||||
'F', 'i', 'l', 'e', 'V', 'e', 'r', 's', 'i', 'o', 'n', 0 };
|
||||
static const WCHAR wInternalName[] = {
|
||||
'I', 'n', 't', 'e', 'r', 'n', 'a', 'l', 'N', 'a', 'm', 'e', 0 };
|
||||
static const WCHAR wOriginalFilename[] = {
|
||||
'O', 'r', 'i', 'g', 'i', 'n', 'a', 'l', 'F', 'i', 'l', 'e', 'n', 'a', 'm', 'e', 0 };
|
||||
static const WCHAR wProductName[] = {
|
||||
'P', 'r', 'o', 'd', 'u', 'c', 't', 'N', 'a', 'm', 'e', 0 };
|
||||
static const WCHAR wProductVersion[] = {
|
||||
'P', 'r', 'o', 'd', 'u', 'c', 't', 'V', 'e', 'r', 's', 'i', 'o', 'n', 0 };
|
||||
static const WCHAR wSlash[] = { '\\', 0 };
|
||||
|
||||
|
||||
if (lpfilename == 0)
|
||||
return FALSE;
|
||||
|
||||
|
@ -457,6 +497,7 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
HeapFree(GetProcessHeap(), 0, pBuf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (VerQueryValueW(pBuf, wSlash, &info, &infolen))
|
||||
{
|
||||
VS_FIXEDFILEINFO *inf = (VS_FIXEDFILEINFO *)info;
|
||||
|
@ -464,11 +505,11 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
LOWORD(inf->dwFileVersionMS),
|
||||
HIWORD(inf->dwFileVersionLS),
|
||||
LOWORD(inf->dwFileVersionLS));
|
||||
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14001);
|
||||
TRACE("MS %x LS %x res %s \n", inf->dwFileVersionMS, inf->dwFileVersionLS, debugstr_w(buff));
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)buff);
|
||||
}
|
||||
|
||||
if (VerQueryValueW(pBuf, wTranslation, (LPVOID *)&lplangcode, &infolen))
|
||||
{
|
||||
/* FIXME find language from current locale / if not available,
|
||||
|
@ -503,6 +544,7 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
str = (WCHAR *) SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)0, (LPARAM)NULL);
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14010);
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -512,22 +554,23 @@ SH_FileVersionInitialize(HWND hwndDlg, WCHAR * lpfilename)
|
|||
*
|
||||
* wnd proc of 'Version' property sheet page
|
||||
*/
|
||||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
SH_FileVersionDlgProc(
|
||||
HWND hwndDlg,
|
||||
SH_FileVersionDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam
|
||||
)
|
||||
LPARAM lParam)
|
||||
{
|
||||
LPPROPSHEETPAGE ppsp;
|
||||
WCHAR *lpstr;
|
||||
LPVOID *buf;
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
ppsp = (LPPROPSHEETPAGE)lParam;
|
||||
|
||||
if (ppsp == NULL)
|
||||
break;
|
||||
|
||||
|
@ -540,7 +583,6 @@ SH_FileVersionDlgProc(
|
|||
|
||||
return SH_FileVersionInitialize(hwndDlg, lpstr);
|
||||
|
||||
|
||||
case WM_COMMAND:
|
||||
if (LOWORD(wParam) == 14009 && HIWORD(wParam) == LBN_DBLCLK)
|
||||
{
|
||||
|
@ -550,19 +592,19 @@ SH_FileVersionDlgProc(
|
|||
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14009);
|
||||
lresult = SendMessageW(hDlgCtrl, LB_GETCURSEL, (WPARAM)NULL, (LPARAM)NULL);
|
||||
|
||||
if (lresult == LB_ERR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
str = (WCHAR *) SendMessageW(hDlgCtrl, LB_GETITEMDATA, (WPARAM)lresult, (LPARAM)NULL);
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
hDlgCtrl = GetDlgItem(hwndDlg, 14010);
|
||||
TRACE("hDlgCtrl %x string %s \n", hDlgCtrl, debugstr_w(str));
|
||||
SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
@ -575,6 +617,7 @@ SH_FileVersionDlgProc(
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -588,21 +631,22 @@ SH_FileVersionDlgProc(
|
|||
|
||||
INT_PTR
|
||||
CALLBACK
|
||||
SH_FileGeneralDlgProc(
|
||||
HWND hwndDlg,
|
||||
SH_FileGeneralDlgProc(HWND hwndDlg,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam
|
||||
)
|
||||
LPARAM lParam)
|
||||
{
|
||||
LPPROPSHEETPAGEW ppsp;
|
||||
WCHAR *lpstr;
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
ppsp = (LPPROPSHEETPAGEW)lParam;
|
||||
|
||||
if (ppsp == NULL)
|
||||
break;
|
||||
|
||||
TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg, lParam, ppsp->lParam);
|
||||
|
||||
lpstr = (WCHAR *)ppsp->lParam;
|
||||
|
@ -612,20 +656,29 @@ SH_FileGeneralDlgProc(
|
|||
ERR("no filename\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* set general text properties filename filelocation and icon */
|
||||
SH_FileGeneralSetText(hwndDlg, lpstr);
|
||||
|
||||
/* enumerate file extension from registry and application which opens it */
|
||||
SH_FileGeneralSetFileType(hwndDlg, wcsrchr(lpstr, '.'));
|
||||
|
||||
/* set file time create/modfied/accessed */
|
||||
SH_FileGeneralSetFileSizeTime(hwndDlg, lpstr, NULL);
|
||||
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK AddShellPropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
|
||||
BOOL
|
||||
CALLBACK
|
||||
AddShellPropSheetExCallback(HPROPSHEETPAGE hPage,
|
||||
LPARAM lParam)
|
||||
{
|
||||
PROPSHEETHEADERW *pinfo = (PROPSHEETHEADERW *)lParam;
|
||||
|
||||
|
@ -634,10 +687,10 @@ BOOL CALLBACK AddShellPropSheetExCallback(HPROPSHEETPAGE hPage, LPARAM lParam)
|
|||
pinfo->u3.phpage[pinfo->nPages++] = hPage;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
EnumPropSheetExt(LPWSTR wFileName, PROPSHEETHEADERW *pinfo, int NumPages, HPSXA *hpsxa, IDataObject *pDataObj)
|
||||
{
|
||||
|
@ -649,9 +702,11 @@ EnumPropSheetExt(LPWSTR wFileName, PROPSHEETHEADERW *pinfo, int NumPages, HPSXA
|
|||
CLSID clsid;
|
||||
|
||||
pOffset = wcsrchr(wFileName, L'.');
|
||||
|
||||
if (!pOffset)
|
||||
{
|
||||
Length = wcslen(szName);
|
||||
|
||||
if (Length + 6 > sizeof(szName) / sizeof(szName[0]))
|
||||
return 0;
|
||||
|
||||
|
@ -668,19 +723,25 @@ EnumPropSheetExt(LPWSTR wFileName, PROPSHEETHEADERW *pinfo, int NumPages, HPSXA
|
|||
else
|
||||
{
|
||||
Length = wcslen(pOffset);
|
||||
|
||||
if (Length >= sizeof(szName) / sizeof(szName[0]))
|
||||
return 0;
|
||||
|
||||
wcscpy(szName, pOffset);
|
||||
}
|
||||
TRACE("EnumPropSheetExt szName %s\n", debugstr_w(szName));
|
||||
hpsxa[0] = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, szName, NumPages, pDataObj);
|
||||
Pages = SHAddFromPropSheetExtArray(hpsxa[0], AddShellPropSheetExCallback, (LPARAM)pinfo);
|
||||
|
||||
TRACE("EnumPropSheetExt szName %s\n", debugstr_w(szName));
|
||||
|
||||
hpsxa[0] = SHCreatePropSheetExtArrayEx(HKEY_CLASSES_ROOT, szName, NumPages, pDataObj);
|
||||
hpsxa[1] = NULL;
|
||||
|
||||
Pages = SHAddFromPropSheetExtArray(hpsxa[0], AddShellPropSheetExCallback, (LPARAM)pinfo);
|
||||
|
||||
if (pOffset)
|
||||
{
|
||||
/* try to load property sheet handlers from prog id key */
|
||||
dwName = sizeof(szName);
|
||||
|
||||
if (RegGetValueW(HKEY_CLASSES_ROOT, pOffset, NULL, RRF_RT_REG_SZ, NULL, szName, &dwName) == ERROR_SUCCESS)
|
||||
{
|
||||
TRACE("EnumPropSheetExt szName %s, pOffset %s\n", debugstr_w(szName), debugstr_w(pOffset));
|
||||
|
@ -689,11 +750,10 @@ EnumPropSheetExt(LPWSTR wFileName, PROPSHEETHEADERW *pinfo, int NumPages, HPSXA
|
|||
Pages += SHAddFromPropSheetExtArray(hpsxa[1], AddShellPropSheetExCallback, (LPARAM)pinfo);
|
||||
}
|
||||
}
|
||||
|
||||
return Pages;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* SH_ShowPropertiesDialog
|
||||
|
@ -728,6 +788,7 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
return FALSE;
|
||||
|
||||
memset(hppages, 0x0, sizeof(HPROPSHEETPAGE) * MAX_PROPERTY_SHEET_PAGE);
|
||||
|
||||
if (lpf[0] == '"')
|
||||
{
|
||||
/* remove quotes from lpf */
|
||||
|
@ -754,26 +815,30 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
return SH_ShowDriveProperties(wFileName, pidlFolder, apidl);
|
||||
}
|
||||
|
||||
|
||||
pFileName = wcsrchr(wFileName, '\\');
|
||||
|
||||
if (!pFileName)
|
||||
pFileName = wFileName;
|
||||
else
|
||||
pFileName++;
|
||||
|
||||
|
||||
memset(&pinfo, 0x0, sizeof(PROPSHEETHEADERW));
|
||||
pinfo.dwSize = sizeof(PROPSHEETHEADERW);
|
||||
pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE;
|
||||
pinfo.u3.phpage = hppages;
|
||||
pinfo.pszCaption = pFileName;
|
||||
|
||||
hppages[pinfo.nPages] = SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG", SH_FileGeneralDlgProc, (LPARAM)wFileName, NULL);
|
||||
hppages[pinfo.nPages] =
|
||||
SH_CreatePropertySheetPage("SHELL_FILE_GENERAL_DLG",
|
||||
SH_FileGeneralDlgProc,
|
||||
(LPARAM)wFileName,
|
||||
NULL);
|
||||
|
||||
if (hppages[pinfo.nPages])
|
||||
pinfo.nPages++;
|
||||
|
||||
|
||||
hResult = SHCreateDataObject(pidlFolder, 1, apidl, NULL, &IID_IDataObject, (LPVOID *)&pDataObj);
|
||||
|
||||
if (hResult == S_OK)
|
||||
{
|
||||
if (!EnumPropSheetExt(wFileName, &pinfo, MAX_PROPERTY_SHEET_PAGE - 1, hpsxa, pDataObj))
|
||||
|
@ -785,7 +850,11 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
|
||||
if (GetFileVersionInfoSizeW(lpf, &dwHandle))
|
||||
{
|
||||
hppages[pinfo.nPages] = SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG",SH_FileVersionDlgProc, (LPARAM)wFileName, NULL);
|
||||
hppages[pinfo.nPages] =
|
||||
SH_CreatePropertySheetPage("SHELL_FILE_VERSION_DLG",
|
||||
SH_FileVersionDlgProc,
|
||||
(LPARAM)wFileName,
|
||||
NULL);
|
||||
if (hppages[pinfo.nPages])
|
||||
pinfo.nPages++;
|
||||
}
|
||||
|
@ -801,4 +870,5 @@ SH_ShowPropertiesDialog(WCHAR * lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST * a
|
|||
|
||||
return (res != -1);
|
||||
}
|
||||
|
||||
/*EOF */
|
||||
|
|
Loading…
Reference in a new issue