mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 09:50:07 +00:00
- implement changing drive volume name
- display default volume label "local disk" if there is no title - verify that provided clsid is valid - display drive property dialog - note: changing volume label currently leads to a crash svn path=/trunk/; revision=34867
This commit is contained in:
parent
8daee04c2a
commit
bbf489032b
|
@ -229,12 +229,13 @@ DriveGeneralDlg(
|
|||
)
|
||||
{
|
||||
LPPROPSHEETPAGEW ppsp;
|
||||
LPDRAWITEMSTRUCT drawItem;
|
||||
LPDRAWITEMSTRUCT drawItem;
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
WCHAR * lpstr;
|
||||
WCHAR szPath[MAX_PATH];
|
||||
UINT length;
|
||||
LPPSHNOTIFY lppsn;
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
|
@ -246,11 +247,11 @@ DriveGeneralDlg(
|
|||
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr);
|
||||
InitializeGeneralDriveDialog(hwndDlg, lpstr);
|
||||
return TRUE;
|
||||
case WM_DRAWITEM:
|
||||
drawItem = (LPDRAWITEMSTRUCT)lParam;
|
||||
if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)
|
||||
case WM_DRAWITEM:
|
||||
drawItem = (LPDRAWITEMSTRUCT)lParam;
|
||||
if (drawItem->CtlID >= 14013 && drawItem->CtlID <= 14015)
|
||||
{
|
||||
PaintStaticControls(hwndDlg, drawItem);
|
||||
PaintStaticControls(hwndDlg, drawItem);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
@ -272,7 +273,32 @@ DriveGeneralDlg(
|
|||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_NOTIFY:
|
||||
lppsn = (LPPSHNOTIFY) lParam;
|
||||
if (LOWORD(wParam) == 14001)
|
||||
{
|
||||
if (HIWORD(wParam) == EN_CHANGE)
|
||||
{
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (lppsn->hdr.code == PSN_APPLY)
|
||||
{
|
||||
lpstr = (LPWSTR)GetWindowLong(hwndDlg, DWLP_USER);
|
||||
if (lpstr && SendDlgItemMessageW(hwndDlg, 14001, WM_GETTEXT, sizeof(szPath)/sizeof(WCHAR), (LPARAM)szPath))
|
||||
{
|
||||
szPath[(sizeof(szPath)/sizeof(WCHAR))-1] = L'\0';
|
||||
SetVolumeLabelW(lpstr, szPath);
|
||||
}
|
||||
SetWindowLong( hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR );
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -409,6 +435,8 @@ SH_ShowDriveProperties(WCHAR * drive)
|
|||
PROPSHEETHEADERW psh;
|
||||
BOOL ret;
|
||||
UINT i;
|
||||
WCHAR szName[MAX_PATH];
|
||||
DWORD dwMaxComponent, dwFileSysFlags;
|
||||
|
||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
||||
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
||||
|
@ -417,6 +445,30 @@ SH_ShowDriveProperties(WCHAR * drive)
|
|||
psh.nStartPage = 0;
|
||||
psh.phpage = hpsp;
|
||||
|
||||
|
||||
if (GetVolumeInformationW(drive, szName, sizeof(szName)/sizeof(WCHAR), NULL, &dwMaxComponent,
|
||||
&dwFileSysFlags, NULL, 0))
|
||||
{
|
||||
psh.pszCaption = szName;
|
||||
psh.dwFlags |= PSH_PROPTITLE;
|
||||
if (!wcslen(szName))
|
||||
{
|
||||
/* FIXME
|
||||
* check if disk is a really a local hdd
|
||||
*/
|
||||
i = LoadStringW(shell32_hInstance, IDS_DRIVE_FIXED, szName, sizeof(szName)/sizeof(WCHAR));
|
||||
if (i > 0 && i < (sizeof(szName)/sizeof(WCHAR)) + 6)
|
||||
{
|
||||
szName[i] = L' ';
|
||||
szName[i+1] = L'(';
|
||||
wcscpy(&szName[i+2], drive);
|
||||
szName[i+4] = L')';
|
||||
szName[i+5] = L'\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < DRIVE_PROPERTY_PAGES; i++)
|
||||
{
|
||||
HPROPSHEETPAGE hprop = SH_CreatePropertySheetPage(PropPages[i].resname, PropPages[i].dlgproc, (LPARAM)drive, NULL);
|
||||
|
|
|
@ -674,6 +674,7 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA
|
|||
UINT Length;
|
||||
DWORD dwName;
|
||||
int Pages;
|
||||
CLSID clsid;
|
||||
|
||||
pOffset = wcsrchr(wFileName, L'.');
|
||||
if (!pOffset)
|
||||
|
@ -681,8 +682,16 @@ EnumPropSheetExt(LPWSTR wFileName, HPROPSHEETPAGE * hppages, int NumPages, HPSXA
|
|||
Length = wcslen(szName);
|
||||
if (Length >=94)
|
||||
return 0;
|
||||
wcscpy(szName, L"CLSID\\");
|
||||
wcscpy(&szName[6], wFileName);
|
||||
|
||||
if (CLSIDFromString(wFileName, &clsid) == NOERROR)
|
||||
{
|
||||
wcscpy(szName, L"CLSID\\");
|
||||
wcscpy(&szName[6], wFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
wcscpy(szName, wFileName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -767,12 +776,17 @@ SH_ShowPropertiesDialog(PCWSTR lpf)
|
|||
strcpyW(wFileName, lpf);
|
||||
}
|
||||
|
||||
if (PathIsDirectoryW(wFileName) || strlenW(wFileName) == 3)
|
||||
if (PathIsDirectoryW(wFileName))
|
||||
{
|
||||
FIXME("directory / drive resources are missing\n");
|
||||
FIXME("directory resources are missing\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
if (wcslen(wFileName) == 3)
|
||||
{
|
||||
return SH_ShowDriveProperties(wFileName);
|
||||
}
|
||||
|
||||
wcscpy(szTemp, wFileName);
|
||||
pFileName = wcsrchr(szTemp, '\\');
|
||||
if (pFileName)
|
||||
|
|
Loading…
Reference in a new issue