Author: janderwald
Date: Tue Oct 2 22:03:15 2007
New Revision: 29359
URL:
http://svn.reactos.org/svn/reactos?rev=29359&view=rev
Log:
- enable cleanup button
- start cleanmgr process on request
Modified:
trunk/reactos/dll/win32/shell32/drive.c
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 22:03:15 2007
@@ -116,11 +116,13 @@
RECT rect;
LONG horzsize;
LARGE_INTEGER Result;
+ WCHAR szBuffer[20];
hBlueBrush = CreateSolidBrush(RGB(0, 0, 255));
hMagBrush = CreateSolidBrush(RGB(255, 0, 255));
- Result.QuadPart = GetWindowLongPtr(hwndDlg, DWLP_USER);
+ SendDlgItemMessageW(hwndDlg, 14007, WM_GETTEXT, 20, (LPARAM)szBuffer);
+ Result.QuadPart = _wtoi(szBuffer);
CopyRect(&rect, &drawItem->rcItem);
horzsize = rect.right - rect.left;
@@ -201,8 +203,6 @@
/* set free bytes percentage */
sprintfW(szResult, L"%02d%%", Result.QuadPart);
SendDlgItemMessageW(hwndDlg, 14007, WM_SETTEXT, (WPARAM)0, (LPARAM)szResult);
- /* store free share amount */
- SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)Result.QuadPart);
/* store used share amount */
Result = LargeIntegerSubtract(ConvertUlongToLargeInteger(100), Result);
sprintfW(szResult, L"%02d%%", Result.QuadPart);
@@ -230,17 +230,20 @@
{
LPPROPSHEETPAGEW ppsp;
LPDRAWITEMSTRUCT drawItem;
-
+ STARTUPINFOW si;
+ PROCESS_INFORMATION pi;
WCHAR * lpstr;
+ WCHAR szPath[MAX_PATH];
+ UINT length;
+
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;
+ SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lpstr);
InitializeGeneralDriveDialog(hwndDlg, lpstr);
return TRUE;
case WM_DRAWITEM:
@@ -250,7 +253,27 @@
PaintStaticControls(hwndDlg, drawItem);
return TRUE;
}
-
+ break;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == 14011)
+ {
+ lpstr = (WCHAR*)GetWindowLongPtr(hwndDlg, DWLP_USER);
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+ if (!GetSystemDirectoryW(szPath, MAX_PATH))
+ break;
+ wcscat(szPath, L"\\cleanmgr.exe /D ");
+ length = wcslen(szPath);
+ szPath[length] = lpstr[0];
+ szPath[length+1] = L'\0';
+ if (CreateProcessW(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&pi))
+ {
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+ }
+ break;
}
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 22:03:15 2007
@@ -247,7 +247,7 @@
CONTROL "", 14015, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW,
20, 140, 200, 20
LTEXT "Laufwerk %s", 14010, 100, 170, 40, 10
- PUSHBUTTON "Bereinigen", 14011, 180, 175, 50, 15, WS_DISABLED
+ PUSHBUTTON "Bereinigen", 14011, 180, 175, 50, 15, WS_TABSTOP
CHECKBOX "Laufwerk komprimieren, um Speicherplatz zu sparen", 14012, 15, 205,
165, 10, WS_DISABLED
CHECKBOX "Laufwerk für schnelle Dateisuche indizieren", 14012, 15, 220, 165,
10, WS_DISABLED
}