Author: janderwald
Date: Tue Oct 2 04:07:22 2007
New Revision: 29349
URL:
http://svn.reactos.org/svn/reactos?rev=29349&view=rev
Log:
- improve drive property dialog a bit
Modified:
trunk/reactos/dll/win32/shell32/drive.c
trunk/reactos/dll/win32/shell32/shell32.rbuild
trunk/reactos/dll/win32/shell32/shell32_De.rc
Modified: trunk/reactos/dll/win32/shell32/drive.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drive.c?…
==============================================================================
--- trunk/reactos/dll/win32/shell32/drive.c (original)
+++ trunk/reactos/dll/win32/shell32/drive.c Tue Oct 2 04:07:22 2007
@@ -20,7 +20,7 @@
#include "config.h"
#include "wine/port.h"
-
+#define YDEBUG
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
@@ -40,8 +40,85 @@
#include "shresdef.h"
#include "undocshell.h"
#include <prsht.h>
+#include <initguid.h>
+#include <devguid.h>
+#include <winioctl.h>
+
+typedef enum
+{
+ HWPD_STANDARDLIST = 0,
+ HWPD_LARGELIST,
+ HWPD_MAX = HWPD_LARGELIST
+} HWPAGE_DISPLAYMODE, *PHWPAGE_DISPLAYMODE;
+
+HWND WINAPI
+DeviceCreateHardwarePageEx(HWND hWndParent,
+ LPGUID lpGuids,
+ UINT uNumberOfGuids,
+ HWPAGE_DISPLAYMODE DisplayMode);
#define DRIVE_PROPERTY_PAGES (3)
+
+static
+void
+InitializeGeneralDriveDialog(HWND hwndDlg, WCHAR * szDrive)
+{
+ WCHAR szVolumeName[MAX_PATH+1] = {0};
+ DWORD MaxComponentLength = 0;
+ DWORD FileSystemFlags = 0;
+ WCHAR FileSystemName[MAX_PATH+1] = {0};
+ BOOL ret;
+ UINT DriveType;
+ ULARGE_INTEGER FreeBytesAvailable;
+ ULARGE_INTEGER TotalNumberOfBytes;
+ ULARGE_INTEGER TotalNumberOfFreeBytes;
+
+ ret = GetVolumeInformationW(szDrive, szVolumeName, MAX_PATH+1, NULL,
&MaxComponentLength, &FileSystemFlags, FileSystemName, MAX_PATH+1);
+ if (ret)
+ {
+ /* set volume label */
+ SendDlgItemMessageW(hwndDlg, 14001, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)szVolumeName);
+
+ /* set filesystem type */
+ SendDlgItemMessageW(hwndDlg, 14003, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)FileSystemName);
+
+ }
+
+ DriveType = GetDriveTypeW(szDrive);
+ if (DriveType == DRIVE_FIXED)
+ {
+ if(GetDiskFreeSpaceExW(szDrive, &FreeBytesAvailable, &TotalNumberOfBytes,
&TotalNumberOfFreeBytes))
+ {
+ WCHAR szResult[128];
+ HANDLE hVolume;
+ DWORD BytesReturned = 0;
+ GET_LENGTH_INFORMATION LengthInformation;
+ if (StrFormatByteSizeW(TotalNumberOfBytes.QuadPart -
FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) / sizeof(WCHAR)))
+ SendDlgItemMessageW(hwndDlg, 14004, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)szResult);
+
+ if (StrFormatByteSizeW(FreeBytesAvailable.QuadPart, szResult, sizeof(szResult) /
sizeof(WCHAR)))
+ SendDlgItemMessageW(hwndDlg, 14006, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)szResult);
+#if 0
+ sprintfW(szResult, L"\\\\.\\%c:", towupper(szDrive[0]));
+ hVolume = CreateFileW(szResult, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
+ if (hVolume != INVALID_HANDLE_VALUE)
+ {
+ RtlZeroMemory(&LengthInformation, sizeof(GET_LENGTH_INFORMATION));
+ ret = DeviceIoControl(hVolume, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0,
(LPVOID)&LengthInformation, sizeof(GET_LENGTH_INFORMATION), &BytesReturned,
NULL);
+ if (ret && StrFormatByteSizeW(LengthInformation.Length.QuadPart,
szResult, sizeof(szResult) / sizeof(WCHAR)))
+ SendDlgItemMessageW(hwndDlg, 14008, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)szResult);
+
+ CloseHandle(hVolume);
+ }
+ TRACE("szResult %s hVOlume %p ret %d LengthInformation %ul Bytesreturned
%d\n", debugstr_w(szResult), hVolume, ret, LengthInformation.Length.QuadPart,
BytesReturned);
+#else
+ if (ret && StrFormatByteSizeW(TotalNumberOfBytes.QuadPart, szResult,
sizeof(szResult) / sizeof(WCHAR)))
+ SendDlgItemMessageW(hwndDlg, 14008, WM_SETTEXT, (WPARAM)NULL,
(LPARAM)szResult);
+#endif
+ }
+ }
+}
+
INT_PTR
CALLBACK
@@ -52,7 +129,21 @@
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;
+ InitializeGeneralDriveDialog(hwndDlg, lpstr);
+ return TRUE;
+ }
return FALSE;
@@ -80,9 +171,24 @@
LPARAM lParam
)
{
-
-
- return FALSE;
+ GUID Guids[1];
+ Guids[0] = GUID_DEVCLASS_DISKDRIVE;
+
+ UNREFERENCED_PARAMETER(lParam);
+ UNREFERENCED_PARAMETER(wParam);
+
+ switch(uMsg)
+ {
+ case WM_INITDIALOG:
+ /* create the hardware page */
+ DeviceCreateHardwarePageEx(hwndDlg,
+ Guids,
+ sizeof(Guids) / sizeof(Guids[0]),
+ 0);
+ break;
+ }
+
+ return FALSE;
}
static
Modified: trunk/reactos/dll/win32/shell32/shell32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32.…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32.rbuild (original)
+++ trunk/reactos/dll/win32/shell32/shell32.rbuild Tue Oct 2 04:07:22 2007
@@ -21,6 +21,7 @@
<library>shlwapi</library>
<library>ole32</library>
<library>version</library>
+ <library>devmgr</library>
<file>authors.c</file>
<file>autocomplete.c</file>
<file>brsfolder.c</file>
Modified: trunk/reactos/dll/win32/shell32/shell32_De.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32_De.rc (original)
+++ trunk/reactos/dll/win32/shell32/shell32_De.rc Tue Oct 2 04:07:22 2007
@@ -225,18 +225,22 @@
EDITTEXT 14001, 40, 20, 190, 10, ES_LEFT|WS_BORDER|WS_GROUP
LTEXT "Typ:", -1, 15, 55, 40, 10
LTEXT "", 14002, 40, 55, 100, 10
- LTEXT "Dateisystem:",-1, 15, 70, 100, 10
- LTEXT "", 14003, 40, 70, 100, 10
+
+ LTEXT "Dateisystem:", -1, 15, 70, 100, 10
+ LTEXT "", 14003, 110, 70, 100, 10
LTEXT "Belegter Speicher:", -1, 25, 90, 120, 10
LTEXT "", 14004, 110, 90, 120, 10
LTEXT "", 14005, 200, 90, 40, 10
+
LTEXT "Freier Speicher:", -1, 25, 105, 70, 10
LTEXT "", 14006, 110, 105, 120, 10
LTEXT "", 14007, 200, 105, 40, 10
+
LTEXT "Speicherkapazität:", -1, 25, 125, 80, 10
LTEXT "", 14008, 110, 125, 120, 10
LTEXT "", 14009, 200, 125, 40, 10
+
LTEXT "", 14010, 150, 160, 40, 10
PUSHBUTTON "Bereinigen", 14011, 190, 145, 50, 15, WS_DISABLED
CHECKBOX "Laufwerk komprimieren, um Speicherplatz zu sparen", 14012, 15, 205,
165, 10, WS_DISABLED