ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

advanced.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS System Control Panel Applet
00003  * LICENSE:     GPL - See COPYING in the top level directory
00004  * FILE:        dll/cpl/sysdm/advanced.c
00005  * PURPOSE:     Memory, start-up and profiles settings
00006  * COPYRIGHT:   Copyright Thomas Weidenmueller <w3seek@reactos.org>
00007                 Copyright 2006 - 2009 Ged Murphy <gedmurphy@reactos.org>
00008  *
00009  */
00010 
00011 #include "precomp.h"
00012 
00013 static TCHAR BugLink[] = _T("http://www.reactos.org/bugzilla");
00014 static TCHAR ReportAsWorkstationKey[] = _T("SYSTEM\\CurrentControlSet\\Control\\ReactOS\\Settings\\Version");
00015 
00016 
00017 static VOID
00018 OnOK(HWND hwndDlg)
00019 {
00020     HKEY hKey;
00021     DWORD ReportAsWorkstation;
00022 
00023     ReportAsWorkstation = (SendDlgItemMessageW(hwndDlg,
00024                                                IDC_REPORTASWORKSTATION,
00025                                                BM_GETCHECK,
00026                                                0,
00027                                                0) == BST_CHECKED);
00028 
00029     if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
00030                        ReportAsWorkstationKey,
00031                        0,
00032                        NULL,
00033                        0,
00034                        KEY_WRITE,
00035                        NULL,
00036                        &hKey,
00037                        NULL) == ERROR_SUCCESS)
00038     {
00039         RegSetValueEx(hKey,
00040                       _T("ReportAsWorkstation"),
00041                       0,
00042                       REG_DWORD,
00043                       (LPBYTE)&ReportAsWorkstation,
00044                       sizeof(DWORD));
00045 
00046         RegCloseKey(hKey);
00047     }
00048 }
00049 
00050 static VOID
00051 OnInitSysSettingsDialog(HWND hwndDlg)
00052 {
00053     HKEY hKey;
00054     DWORD dwVal;
00055     DWORD dwType = REG_DWORD;
00056     DWORD cbData = sizeof(DWORD);
00057 
00058     if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
00059                      ReportAsWorkstationKey,
00060                      0,
00061                      KEY_READ,
00062                      &hKey) == ERROR_SUCCESS)
00063     {
00064         if (RegQueryValueEx(hKey,
00065                             _T("ReportAsWorkstation"),
00066                             0,
00067                             &dwType,
00068                             (LPBYTE)&dwVal,
00069                             &cbData) == ERROR_SUCCESS)
00070         {
00071             if (dwVal == TRUE)
00072             {
00073                 // set the check box
00074                 SendDlgItemMessageW(hwndDlg,
00075                                     IDC_REPORTASWORKSTATION,
00076                                     BM_SETCHECK,
00077                                     BST_CHECKED,
00078                                     0);
00079             }
00080         }
00081 
00082         RegCloseKey(hKey);
00083     }
00084 }
00085 
00086 INT_PTR CALLBACK
00087 SysSettingsDlgProc(HWND hwndDlg,
00088                    UINT uMsg,
00089                    WPARAM wParam,
00090                    LPARAM lParam)
00091 {
00092     UNREFERENCED_PARAMETER(lParam);
00093 
00094     switch (uMsg)
00095     {
00096         case WM_INITDIALOG:
00097             OnInitSysSettingsDialog(hwndDlg);
00098             break;
00099 
00100         case WM_COMMAND:
00101             switch (LOWORD(wParam))
00102             {
00103                 case IDOK:
00104                     OnOK(hwndDlg);
00105                     EndDialog(hwndDlg, 0);
00106                     return TRUE;
00107             }
00108             break;
00109     }
00110 
00111     return FALSE;
00112 }
00113 
00114 
00115 /* Property page dialog callback */
00116 INT_PTR CALLBACK
00117 AdvancedPageProc(HWND hwndDlg,
00118                  UINT uMsg,
00119                  WPARAM wParam,
00120                  LPARAM lParam)
00121 {
00122     UNREFERENCED_PARAMETER(lParam);
00123 
00124     switch (uMsg)
00125     {
00126         case WM_INITDIALOG:
00127             break;
00128 
00129         case WM_COMMAND:
00130         {
00131             switch (LOWORD(wParam))
00132             {
00133                 case IDC_PERFOR:
00134                     DialogBox(hApplet,
00135                               MAKEINTRESOURCE(IDD_VIRTMEM),
00136                               hwndDlg,
00137                               (DLGPROC)VirtMemDlgProc);
00138                     break;
00139 
00140                 case IDC_USERPROFILE:
00141                     DialogBox(hApplet,
00142                               MAKEINTRESOURCE(IDD_USERPROFILE),
00143                               hwndDlg,
00144                               (DLGPROC)UserProfileDlgProc);
00145                     break;
00146 
00147                 case IDC_STAREC:
00148                     DialogBox(hApplet,
00149                               MAKEINTRESOURCE(IDD_STARTUPRECOVERY),
00150                               hwndDlg,
00151                               (DLGPROC)StartRecDlgProc);
00152                     break;
00153 
00154                 case IDC_SYSSETTINGS:
00155                     DialogBox(hApplet,
00156                               MAKEINTRESOURCE(IDD_SYSSETTINGS),
00157                               hwndDlg,
00158                               (DLGPROC)SysSettingsDlgProc);
00159                     break;
00160 
00161                 case IDC_ENVVAR:
00162                     DialogBox(hApplet,
00163                               MAKEINTRESOURCE(IDD_ENVIRONMENT_VARIABLES),
00164                               hwndDlg,
00165                               (DLGPROC)EnvironmentDlgProc);
00166                     break;
00167 
00168                 case IDC_ERRORREPORT:
00169                     ShellExecute(NULL,
00170                                  _T("open"),
00171                                  BugLink,
00172                                  NULL,
00173                                  NULL,
00174                                  SW_SHOWNORMAL);
00175                     break;
00176             }
00177         }
00178 
00179         break;
00180     }
00181 
00182     return FALSE;
00183 }

Generated on Sun May 27 2012 04:20:57 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.