Coding style clean-up. No code changes.

svn path=/trunk/; revision=30090
This commit is contained in:
Eric Kohl 2007-11-03 14:39:08 +00:00
parent f9e795297b
commit ee5fa63537
10 changed files with 211 additions and 226 deletions

View file

@ -31,55 +31,46 @@ AdvancedPageProc(HWND hwndDlg,
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDC_PERFOR: case IDC_PERFOR:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_VIRTMEM), MAKEINTRESOURCE(IDD_VIRTMEM),
hwndDlg, hwndDlg,
(DLGPROC)VirtMemDlgProc); (DLGPROC)VirtMemDlgProc);
}
break; break;
case IDC_USERPROFILE: case IDC_USERPROFILE:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_USERPROFILE), MAKEINTRESOURCE(IDD_USERPROFILE),
hwndDlg, hwndDlg,
(DLGPROC)UserProfileDlgProc); (DLGPROC)UserProfileDlgProc);
}
break; break;
case IDC_STAREC: case IDC_STAREC:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_STARTUPRECOVERY), MAKEINTRESOURCE(IDD_STARTUPRECOVERY),
hwndDlg, hwndDlg,
(DLGPROC)StartRecDlgProc); (DLGPROC)StartRecDlgProc);
}
break; break;
case IDC_ENVVAR: case IDC_ENVVAR:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES), MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES),
hwndDlg, hwndDlg,
(DLGPROC)EnvironmentDlgProc); (DLGPROC)EnvironmentDlgProc);
}
break; break;
case IDC_ERRORREPORT: case IDC_ERRORREPORT:
{
ShellExecute(NULL, ShellExecute(NULL,
_T("open"), _T("open"),
BugLink, BugLink,
NULL, NULL,
NULL, NULL,
SW_SHOWNORMAL); SW_SHOWNORMAL);
}
break; break;
} }
} }
break; break;
} }
return FALSE; return FALSE;
} }

View file

@ -91,7 +91,8 @@ SetRegTextData(HWND hwnd,
lpBuf = HeapAlloc(GetProcessHeap(), lpBuf = HeapAlloc(GetProcessHeap(),
0, 0,
BufSize); BufSize);
if (!lpBuf) return; if (!lpBuf)
return;
if (RegQueryValueEx(hKey, if (RegQueryValueEx(hKey,
Value, Value,
@ -136,7 +137,8 @@ SetProcNameString(HWND hwnd,
lpBuf = HeapAlloc(GetProcessHeap(), lpBuf = HeapAlloc(GetProcessHeap(),
0, 0,
BufSize); BufSize);
if (!lpBuf) return 0; if (!lpBuf)
return 0;
if (RegQueryValueEx(hKey, if (RegQueryValueEx(hKey,
Value, Value,
@ -160,7 +162,9 @@ SetProcNameString(HWND hwnd,
szLastSpace = _tcsrchr(szBuf, ' '); szLastSpace = _tcsrchr(szBuf, ' ');
if (szLastSpace == 0) if (szLastSpace == 0)
{
LastSpace = 30; LastSpace = 30;
}
else else
{ {
LastSpace = (szLastSpace - szBuf); LastSpace = (szLastSpace - szBuf);
@ -205,13 +209,13 @@ MakeFloatValueString(double* dFloatValue,
{ {
TCHAR szDecimalSeparator[4]; TCHAR szDecimalSeparator[4];
// Get the decimal separator for the current locale /* Get the decimal separator for the current locale */
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0) if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, szDecimalSeparator, sizeof(szDecimalSeparator) / sizeof(TCHAR)) > 0)
{ {
UCHAR uDecimals; UCHAR uDecimals;
UINT uIntegral; UINT uIntegral;
// Show the value with two decimals /* Show the value with two decimals */
uIntegral = (UINT)*dFloatValue; uIntegral = (UINT)*dFloatValue;
uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100); uDecimals = (UCHAR)((UINT)(*dFloatValue * 100) - uIntegral * 100);
@ -337,10 +341,14 @@ GetSystemInformation(HWND hwnd)
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
} }
else else
{
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
} }
}
else else
{
dTotalPhys = (double)MemStat.ullTotalPhys / 1024; dTotalPhys = (double)MemStat.ullTotalPhys / 1024;
}
LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR)); LoadString(hApplet, uStrId[i], szStr, sizeof(szStr) / sizeof(TCHAR));
MakeFloatValueString(&dTotalPhys, Buf, szStr); MakeFloatValueString(&dTotalPhys, Buf, szStr);
@ -372,14 +380,11 @@ GeneralPageProc(HWND hwndDlg,
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
InitImageInfo(&ImgInfo); InitImageInfo(&ImgInfo);
GetSystemInformation(hwndDlg); GetSystemInformation(hwndDlg);
}
break; break;
case WM_COMMAND: case WM_COMMAND:
{
if (LOWORD(wParam) == IDC_LICENCE) if (LOWORD(wParam) == IDC_LICENCE)
{ {
DialogBox(hApplet, DialogBox(hApplet,
@ -389,7 +394,6 @@ GeneralPageProc(HWND hwndDlg,
return TRUE; return TRUE;
} }
}
break; break;
case WM_DRAWITEM: case WM_DRAWITEM:

View file

@ -19,23 +19,20 @@ RenameProfDlgProc(HWND hwndDlg,
UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg); UNREFERENCED_PARAMETER(hwndDlg);
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
}
break; break;
case WM_COMMAND: case WM_COMMAND:
{
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{ {
EndDialog(hwndDlg, EndDialog(hwndDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
} }
}
break; break;
} }
return FALSE; return FALSE;
@ -52,36 +49,31 @@ HardProfDlgProc(HWND hwndDlg,
UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg); UNREFERENCED_PARAMETER(hwndDlg);
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
}
break; break;
case WM_COMMAND: case WM_COMMAND:
{
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDC_HRDPROFRENAME: case IDC_HRDPROFRENAME:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_RENAMEPROFILE), MAKEINTRESOURCE(IDD_RENAMEPROFILE),
hwndDlg, hwndDlg,
(DLGPROC)RenameProfDlgProc); (DLGPROC)RenameProfDlgProc);
} break;
case IDOK: case IDOK:
case IDCANCEL: case IDCANCEL:
{
EndDialog(hwndDlg, EndDialog(hwndDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
} }
}
}
break; break;
} }
return FALSE; return FALSE;
} }

View file

@ -12,7 +12,8 @@
typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow); typedef BOOL (STDCALL *PDEVMGREXEC)(HWND hWndParent, HINSTANCE hInst, PVOID Unknown, int nCmdShow);
BOOL LaunchDeviceManager(HWND hWndParent) static BOOL
LaunchDeviceManager(HWND hWndParent)
{ {
/* hack for ROS to start our devmgmt until we have mmc */ /* hack for ROS to start our devmgmt until we have mmc */
#ifdef __REACTOS__ #ifdef __REACTOS__
@ -55,30 +56,22 @@ HardwarePageProc(HWND hwndDlg,
break; break;
case WM_COMMAND: case WM_COMMAND:
{
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDC_HARDWARE_DEVICE_MANAGER: case IDC_HARDWARE_DEVICE_MANAGER:
{
if (!LaunchDeviceManager(hwndDlg)) if (!LaunchDeviceManager(hwndDlg))
{ {
/* FIXME */ /* FIXME */
} }
return TRUE; return TRUE;
}
case IDC_HARDWARE_PROFILE: case IDC_HARDWARE_PROFILE:
{
DialogBox(hApplet, DialogBox(hApplet,
MAKEINTRESOURCE(IDD_HARDWAREPROFILES), MAKEINTRESOURCE(IDD_HARDWAREPROFILES),
hwndDlg, hwndDlg,
(DLGPROC)HardProfDlgProc); (DLGPROC)HardProfDlgProc);
return TRUE; return TRUE;
} }
}
}
break; break;
} }

View file

@ -12,7 +12,7 @@
INT_PTR CALLBACK INT_PTR CALLBACK
LicenceDlgProc(HWND hDlg, LicenceDlgProc(HWND hDlg,
UINT message, UINT uMsg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
@ -23,10 +23,9 @@ LicenceDlgProc(HWND hDlg,
UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(lParam);
switch (message) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
hIcon = LoadImage(hApplet, hIcon = LoadImage(hApplet,
MAKEINTRESOURCE(IDI_CPLSYSTEM), MAKEINTRESOURCE(IDI_CPLSYSTEM),
IMAGE_ICON, IMAGE_ICON,
@ -61,10 +60,8 @@ LicenceDlgProc(HWND hDlg,
0); 0);
return TRUE; return TRUE;
}
case WM_COMMAND: case WM_COMMAND:
{
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{ {
DestroyIcon(hIcon); DestroyIcon(hIcon);
@ -72,7 +69,6 @@ LicenceDlgProc(HWND hDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
} }
}
break; break;
} }

View file

@ -1,4 +1,3 @@
/* /*
* PROJECT: ReactOS System Control Panel Applet * PROJECT: ReactOS System Control Panel Applet
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
@ -16,7 +15,8 @@ static TCHAR m_szDumpFile[MAX_PATH];
static TCHAR m_szMinidumpDir[MAX_PATH]; static TCHAR m_szMinidumpDir[MAX_PATH];
static DWORD m_dwCrashDumpEnabled = 0; static DWORD m_dwCrashDumpEnabled = 0;
void SetTimeout(HWND hwndDlg, int Timeout) static VOID
SetTimeout(HWND hwndDlg, INT Timeout)
{ {
if (Timeout == 0) if (Timeout == 0)
{ {
@ -26,12 +26,15 @@ void SetTimeout(HWND hwndDlg, int Timeout)
{ {
EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE); EnableWindow(GetDlgItem(hwndDlg, IDC_STRRECLISTUPDWN), TRUE);
} }
SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0)); SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_SETPOS, (WPARAM) 0, (LPARAM) MAKELONG((short) Timeout, 0));
} }
DWORD GetSystemDrive(TCHAR ** szSystemDrive) static DWORD
GetSystemDrive(TCHAR **szSystemDrive)
{ {
DWORD dwBufSize; DWORD dwBufSize;
/* get Path to freeldr.ini or boot.ini */ /* get Path to freeldr.ini or boot.ini */
*szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR)); *szSystemDrive = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(TCHAR));
if (szSystemDrive != NULL) if (szSystemDrive != NULL)
@ -59,12 +62,15 @@ FailGetSysDrive:
*szSystemDrive = NULL; *szSystemDrive = NULL;
return FALSE; return FALSE;
} }
return dwBufSize; return dwBufSize;
} }
return FALSE; return FALSE;
} }
PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName) static PBOOTRECORD
ReadFreeldrSection(HINF hInf, TCHAR *szSectionName)
{ {
PBOOTRECORD pRecord; PBOOTRECORD pRecord;
INFCONTEXT InfContext; INFCONTEXT InfContext;
@ -86,6 +92,7 @@ PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName)
{ {
return NULL; return NULL;
} }
_tcscpy(pRecord->szSectionName, szSectionName); _tcscpy(pRecord->szSectionName, szSectionName);
do do
@ -108,7 +115,6 @@ PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName)
break; break;
} }
if (!_tcsnicmp(szName, _T("BootType"), 8)) if (!_tcsnicmp(szName, _T("BootType"), 8))
{ {
if (!_tcsnicmp(szValue, _T("ReactOS"), 7)) if (!_tcsnicmp(szValue, _T("ReactOS"), 7))
@ -131,13 +137,15 @@ PBOOTRECORD ReadFreeldrSection(HINF hInf, TCHAR * szSectionName)
_tcscpy(pRecord->szOptions, szValue); _tcscpy(pRecord->szOptions, szValue);
} }
}while(SetupFindNextLine(&InfContext, &InfContext)); }
while (SetupFindNextLine(&InfContext, &InfContext));
return pRecord; return pRecord;
} }
int LoadFreeldrSettings(HINF hInf, HWND hwndDlg) static INT
LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
{ {
INFCONTEXT InfContext; INFCONTEXT InfContext;
PBOOTRECORD pRecord; PBOOTRECORD pRecord;
@ -228,15 +236,14 @@ int LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
/* we store the friendly name as key */ /* we store the friendly name as key */
_tcscpy(szDefaultOs, szValue); _tcscpy(szDefaultOs, szValue);
} }
} }
else else
{ {
HeapFree(GetProcessHeap(), 0, pRecord); HeapFree(GetProcessHeap(), 0, pRecord);
} }
} }
}
}while(SetupFindNextLine(&InfContext, &InfContext)); while (SetupFindNextLine(&InfContext, &InfContext));
/* find default os in list */ /* find default os in list */
lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szDefaultOs); lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)szDefaultOs);
@ -250,11 +257,14 @@ int LoadFreeldrSettings(HINF hInf, HWND hwndDlg)
{ {
SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
} }
SetTimeout(hwndDlg, TimeOut); SetTimeout(hwndDlg, TimeOut);
return TRUE; return TRUE;
} }
int LoadBootSettings(HINF hInf, HWND hwndDlg) static INT
LoadBootSettings(HINF hInf, HWND hwndDlg)
{ {
INFCONTEXT InfContext; INFCONTEXT InfContext;
TCHAR szName[MAX_PATH]; TCHAR szName[MAX_PATH];
@ -304,7 +314,8 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg)
_tcscpy(szDefaultOS, szValue); _tcscpy(szDefaultOS, szValue);
} }
}while(SetupFindNextLine(&InfContext, &InfContext)); }
while (SetupFindNextLine(&InfContext, &InfContext));
if (!SetupFindFirstLine(hInf, if (!SetupFindFirstLine(hInf,
_T("operating systems"), _T("operating systems"),
@ -366,7 +377,9 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg)
} }
} }
}while(SetupFindNextLine(&InfContext, &InfContext)); }
while (SetupFindNextLine(&InfContext, &InfContext));
/* find default os in list */ /* find default os in list */
lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0, (LPARAM)szDefaultOS); lResult = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_FINDSTRING, (WPARAM)0, (LPARAM)szDefaultOS);
if (lResult != CB_ERR) if (lResult != CB_ERR)
@ -374,22 +387,24 @@ int LoadBootSettings(HINF hInf, HWND hwndDlg)
/* set cur sel */ /* set cur sel */
SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0); SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_SETCURSEL, (WPARAM)lResult, (LPARAM)0);
} }
if(TimeOut) if(TimeOut)
{ {
SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0);
} }
SetTimeout(hwndDlg, TimeOut); SetTimeout(hwndDlg, TimeOut);
return TRUE; return TRUE;
} }
void DeleteBootRecords(HWND hwndDlg) static VOID
DeleteBootRecords(HWND hwndDlg)
{ {
LRESULT lIndex; LRESULT lIndex;
LONG index; LONG index;
PBOOTRECORD pRecord; PBOOTRECORD pRecord;
lIndex = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETCOUNT, (WPARAM)0, (LPARAM)0); lIndex = SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETCOUNT, (WPARAM)0, (LPARAM)0);
if (lIndex == CB_ERR) if (lIndex == CB_ERR)
return; return;
@ -402,10 +417,12 @@ void DeleteBootRecords(HWND hwndDlg)
HeapFree(GetProcessHeap(), 0, pRecord); HeapFree(GetProcessHeap(), 0, pRecord);
} }
} }
SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0); SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0);
} }
LRESULT LoadOSList(HWND hwndDlg) static LRESULT
LoadOSList(HWND hwndDlg)
{ {
DWORD dwBufSize; DWORD dwBufSize;
TCHAR *szSystemDrive; TCHAR *szSystemDrive;
@ -415,9 +432,9 @@ LRESULT LoadOSList(HWND hwndDlg)
if (!dwBufSize) if (!dwBufSize)
return FALSE; return FALSE;
_tcscpy(m_szFreeldrIni, szSystemDrive); _tcscpy(m_szFreeldrIni, szSystemDrive);
_tcscat(m_szFreeldrIni, _T("\\freeldr.ini")); _tcscat(m_szFreeldrIni, _T("\\freeldr.ini"));
if (PathFileExists(m_szFreeldrIni)) if (PathFileExists(m_szFreeldrIni))
{ {
/* freeldr.ini exists */ /* freeldr.ini exists */
@ -435,6 +452,7 @@ LRESULT LoadOSList(HWND hwndDlg)
} }
return FALSE; return FALSE;
} }
/* try load boot.ini settings */ /* try load boot.ini settings */
_tcscpy(m_szFreeldrIni, szSystemDrive); _tcscpy(m_szFreeldrIni, szSystemDrive);
_tcscat(m_szFreeldrIni, _T("\\boot.ini")); _tcscat(m_szFreeldrIni, _T("\\boot.ini"));
@ -454,12 +472,15 @@ LRESULT LoadOSList(HWND hwndDlg)
m_FreeLdrIni = 2; m_FreeLdrIni = 2;
return TRUE; return TRUE;
} }
return FALSE;
}
return FALSE; return FALSE;
} }
void SetCrashDlgItems(HWND hwnd) return FALSE;
}
static VOID
SetCrashDlgItems(HWND hwnd)
{ {
if (m_dwCrashDumpEnabled == 0) if (m_dwCrashDumpEnabled == 0)
{ {
@ -484,7 +505,8 @@ void SetCrashDlgItems(HWND hwnd)
SendDlgItemMessage(hwnd, IDC_STRRECDEBUGCOMBO, CB_SETCURSEL, (WPARAM)m_dwCrashDumpEnabled, (LPARAM)0); SendDlgItemMessage(hwnd, IDC_STRRECDEBUGCOMBO, CB_SETCURSEL, (WPARAM)m_dwCrashDumpEnabled, (LPARAM)0);
} }
void WriteStartupRecoveryOptions(HWND hwndDlg) static VOID
WriteStartupRecoveryOptions(HWND hwndDlg)
{ {
HKEY hKey; HKEY hKey;
DWORD lResult; DWORD lResult;
@ -526,7 +548,8 @@ void WriteStartupRecoveryOptions(HWND hwndDlg)
RegCloseKey(hKey); RegCloseKey(hKey);
} }
void LoadRecoveryOptions(HWND hwndDlg) static VOID
LoadRecoveryOptions(HWND hwndDlg)
{ {
HKEY hKey; HKEY hKey;
DWORD dwValues; DWORD dwValues;
@ -617,10 +640,13 @@ void LoadRecoveryOptions(HWND hwndDlg)
if (LoadString(hApplet, IDS_NO_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR)) if (LoadString(hApplet, IDS_NO_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue); SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
if (LoadString(hApplet, IDS_FULL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR)) if (LoadString(hApplet, IDS_FULL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue); SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
if (LoadString(hApplet, IDS_KERNEL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR)) if (LoadString(hApplet, IDS_KERNEL_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue); SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
if (LoadString(hApplet, IDS_MINI_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR)) if (LoadString(hApplet, IDS_MINI_DUMP, szValue, sizeof(szValue) / sizeof(TCHAR)) < sizeof(szValue) / sizeof(TCHAR))
SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue); SendDlgItemMessage(hwndDlg, IDC_STRRECDEBUGCOMBO, CB_ADDSTRING, (WPARAM)0, (LPARAM) szValue);
@ -629,7 +655,6 @@ void LoadRecoveryOptions(HWND hwndDlg)
} }
/* Property page dialog callback */ /* Property page dialog callback */
INT_PTR CALLBACK INT_PTR CALLBACK
StartRecDlgProc(HWND hwndDlg, StartRecDlgProc(HWND hwndDlg,
@ -647,26 +672,20 @@ StartRecDlgProc(HWND hwndDlg,
switch(uMsg) switch(uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
LoadRecoveryOptions(hwndDlg); LoadRecoveryOptions(hwndDlg);
return LoadOSList(hwndDlg); return LoadOSList(hwndDlg);
}
break;
case WM_COMMAND: case WM_COMMAND:
{
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
case IDC_STRRECEDIT: case IDC_STRRECEDIT:
{
ShellExecute(0, _T("open"), _T("notepad"), m_szFreeldrIni, NULL, SW_SHOWNORMAL); ShellExecute(0, _T("open"), _T("notepad"), m_szFreeldrIni, NULL, SW_SHOWNORMAL);
// FIXME use CreateProcess and wait untill finished // FIXME use CreateProcess and wait untill finished
// DeleteBootRecords(hwndDlg); // DeleteBootRecords(hwndDlg);
// LoadOSList(hwndDlg); // LoadOSList(hwndDlg);
break; break;
}
case IDOK: case IDOK:
{
/* save timeout */ /* save timeout */
if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED) if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED)
iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0); iTimeout = SendDlgItemMessage(hwndDlg, IDC_STRRECLISTUPDWN, UDM_GETPOS, (WPARAM)0, (LPARAM)0);
@ -682,7 +701,6 @@ StartRecDlgProc(HWND hwndDlg,
return TRUE; return TRUE;
} }
pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0); pRecord = (PBOOTRECORD) SendDlgItemMessage(hwndDlg, IDC_STRECOSCOMBO, CB_GETITEMDATA, (WPARAM)lResult, (LPARAM)0);
if ((INT)pRecord != CB_ERR) if ((INT)pRecord != CB_ERR)
@ -716,28 +734,27 @@ StartRecDlgProc(HWND hwndDlg,
} }
} }
WriteStartupRecoveryOptions(hwndDlg); WriteStartupRecoveryOptions(hwndDlg);
DeleteBootRecords(hwndDlg); DeleteBootRecords(hwndDlg);
EndDialog(hwndDlg, EndDialog(hwndDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
}
case IDCANCEL: case IDCANCEL:
{
DeleteBootRecords(hwndDlg); DeleteBootRecords(hwndDlg);
EndDialog(hwndDlg, EndDialog(hwndDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
}
case IDC_STRECLIST: case IDC_STRECLIST:
{
if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED) if (SendDlgItemMessage(hwndDlg, IDC_STRECLIST, BM_GETCHECK, (WPARAM)0, (LPARAM)0) == BST_CHECKED)
SetTimeout(hwndDlg, 30); SetTimeout(hwndDlg, 30);
else else
SetTimeout(hwndDlg, 0); SetTimeout(hwndDlg, 0);
} break;
case IDC_STRRECDEBUGCOMBO: case IDC_STRRECDEBUGCOMBO:
{
if (HIWORD(wParam) == CBN_SELCHANGE) if (HIWORD(wParam) == CBN_SELCHANGE)
{ {
LRESULT lResult; LRESULT lResult;
@ -753,16 +770,15 @@ StartRecDlgProc(HWND hwndDlg,
{ {
SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(m_szMinidumpDir) / sizeof(TCHAR), (LPARAM)m_szMinidumpDir); SendDlgItemMessage(hwndDlg, IDC_STRRECDUMPFILE, WM_GETTEXT, (WPARAM)sizeof(m_szMinidumpDir) / sizeof(TCHAR), (LPARAM)m_szMinidumpDir);
} }
m_dwCrashDumpEnabled = lResult; m_dwCrashDumpEnabled = lResult;
SetCrashDlgItems(hwndDlg); SetCrashDlgItems(hwndDlg);
} }
} }
break; break;
} }
}
}
break; break;
} }
return FALSE; return FALSE;
} }

View file

@ -148,25 +148,23 @@ SystemApplet(VOID)
/* Control Panel Callback */ /* Control Panel Callback */
LONG CALLBACK LONG CALLBACK
CPlApplet( CPlApplet(HWND hwndCPl,
HWND hwndCPl,
UINT uMsg, UINT uMsg,
LPARAM lParam1, LPARAM lParam1,
LPARAM lParam2) LPARAM lParam2)
{ {
int i = (int)lParam1; INT i = (INT)lParam1;
UNREFERENCED_PARAMETER(hwndCPl); UNREFERENCED_PARAMETER(hwndCPl);
switch (uMsg) switch (uMsg)
{ {
case CPL_INIT: case CPL_INIT:
{
return TRUE; return TRUE;
}
case CPL_GETCOUNT: case CPL_GETCOUNT:
{
return NUM_APPLETS; return NUM_APPLETS;
}
case CPL_INQUIRE: case CPL_INQUIRE:
{ {
CPLINFO *CPlInfo = (CPLINFO*)lParam2; CPLINFO *CPlInfo = (CPLINFO*)lParam2;
@ -174,25 +172,25 @@ CPlApplet(
CPlInfo->idIcon = Applets[i].idIcon; CPlInfo->idIcon = Applets[i].idIcon;
CPlInfo->idName = Applets[i].idName; CPlInfo->idName = Applets[i].idName;
CPlInfo->idInfo = Applets[i].idDescription; CPlInfo->idInfo = Applets[i].idDescription;
break;
} }
break;
case CPL_DBLCLK: case CPL_DBLCLK:
{
Applets[i].AppletProc(); Applets[i].AppletProc();
break; break;
} }
}
return FALSE; return FALSE;
} }
BOOL STDCALL BOOL STDCALL
DllMain( DllMain(HINSTANCE hinstDLL,
HINSTANCE hinstDLL,
DWORD dwReason, DWORD dwReason,
LPVOID lpvReserved) LPVOID lpvReserved)
{ {
UNREFERENCED_PARAMETER(lpvReserved); UNREFERENCED_PARAMETER(lpvReserved);
switch (dwReason) switch (dwReason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
@ -200,5 +198,6 @@ DllMain(
hApplet = hinstDLL; hApplet = hinstDLL;
break; break;
} }
return TRUE; return TRUE;
} }

View file

@ -17,27 +17,19 @@ UserProfileDlgProc(HWND hwndDlg,
WPARAM wParam, WPARAM wParam,
LPARAM lParam) LPARAM lParam)
{ {
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg);
switch (uMsg) switch (uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0); MessageBox(hwndDlg, _T("Dialog not yet implemented!"), NULL, 0);
}
break; break;
case WM_COMMAND: case WM_COMMAND:
{
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
{ {
EndDialog(hwndDlg, EndDialog(hwndDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
} }
}
break; break;
case WM_NOTIFY: case WM_NOTIFY:
@ -56,5 +48,6 @@ UserProfileDlgProc(HWND hwndDlg,
break; break;
} }
} }
return FALSE; return FALSE;
} }

View file

@ -188,6 +188,7 @@ WritePageFileSettings(PVIRTMEM pVirtMem)
{ {
HKEY hk = NULL; HKEY hk = NULL;
TCHAR szPagingFiles[2048]; TCHAR szPagingFiles[2048];
TCHAR szText[256];
INT i; INT i;
INT nPos = 0; INT nPos = 0;
BOOL bErr = TRUE; BOOL bErr = TRUE;
@ -196,8 +197,6 @@ WritePageFileSettings(PVIRTMEM pVirtMem)
{ {
if (pVirtMem->Pagefile[i].bUsed) if (pVirtMem->Pagefile[i].bUsed)
{ {
TCHAR szText[256];
_stprintf(szText, _T("%s\\pagefile.sys %i %i"), _stprintf(szText, _T("%s\\pagefile.sys %i %i"),
pVirtMem->Pagefile[i].szDrive, pVirtMem->Pagefile[i].szDrive,
pVirtMem->Pagefile[i].InitialValue, pVirtMem->Pagefile[i].InitialValue,
@ -247,6 +246,7 @@ static VOID
SetListBoxColumns(HWND hwndListBox) SetListBoxColumns(HWND hwndListBox)
{ {
const INT tabs[2] = {30, 170}; const INT tabs[2] = {30, 170};
SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)&tabs[0]); SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)&tabs[0]);
} }
@ -292,7 +292,6 @@ OnSet(PVIRTMEM pVirtMem)
LB_GETCURSEL, LB_GETCURSEL,
0, 0,
0); 0);
if (Index < pVirtMem->Count) if (Index < pVirtMem->Count)
{ {
/* check if custom settings are checked */ /* check if custom settings are checked */
@ -313,7 +312,9 @@ OnSet(PVIRTMEM pVirtMem)
FALSE); FALSE);
} }
else else
{
pVirtMem->Pagefile[Index].InitialValue = Value; pVirtMem->Pagefile[Index].InitialValue = Value;
}
Value = GetDlgItemInt(pVirtMem->hSelf, Value = GetDlgItemInt(pVirtMem->hSelf,
IDC_MAXSIZE, IDC_MAXSIZE,
@ -329,8 +330,10 @@ OnSet(PVIRTMEM pVirtMem)
FALSE); FALSE);
} }
else else
{
pVirtMem->Pagefile[Index].MaxValue = Value; pVirtMem->Pagefile[Index].MaxValue = Value;
} }
}
else else
{ {
/* set sizes to 0 */ /* set sizes to 0 */
@ -491,7 +494,6 @@ VirtMemDlgProc(HWND hwndDlg,
break; break;
case WM_COMMAND: case WM_COMMAND:
{
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDCANCEL: case IDCANCEL:
@ -529,7 +531,6 @@ VirtMemDlgProc(HWND hwndDlg,
} }
break; break;
} }
}
break; break;
} }