ReactOS  0.4.12-dev-36-g472787f
generalpage.c File Reference
#include "precomp.h"
#include "fileutils.h"
#include "utils.h"
#include "comctl32supp.h"
#include "fileextractdialog.h"
Include dependency graph for generalpage.c:

Go to the source code of this file.

Functions

static VOID EnableSelectiveStartupControls (BOOL bEnable)
 
static VOID CheckSelectiveStartupControls (BOOL bCheck)
 
INT_PTR CALLBACK GeneralPageWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 

Variables

static LPCWSTR lpszRestoreProgPath1 = L"%SystemRoot%\\System32\\rstrui.exe"
 
static LPCWSTR lpszRestoreProgPath2 = L"%SystemRoot%\\System32\\restore\\rstrui.exe"
 
static HWND hGeneralPage = NULL
 
static BOOL bIsOriginalBootIni = TRUE
 

Function Documentation

◆ CheckSelectiveStartupControls()

static VOID CheckSelectiveStartupControls ( BOOL  bCheck)
static

Definition at line 41 of file generalpage.c.

Referenced by GeneralPageWndProc().

42 {
44 
50 
51  return;
52 }
#define IDC_CBX_LOAD_STARTUP_ITEMS
Definition: resource.h:28
#define assert(x)
Definition: debug.h:53
#define IDC_CBX_WIN_INI
Definition: resource.h:26
#define IDC_CBX_USE_ORIGINAL_BOOTCFG
Definition: resource.h:29
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_CBX_LOAD_SYSTEM_SERVICES
Definition: resource.h:27
#define BST_UNCHECKED
Definition: winuser.h:199
#define IDC_CBX_SYSTEM_INI
Definition: resource.h:27
HWND hGeneralPage
Definition: generalpage.c:12
#define BST_CHECKED
Definition: winuser.h:197
#define Button_SetCheck(hwndCtl, check)
Definition: windowsx.h:10

◆ EnableSelectiveStartupControls()

static VOID EnableSelectiveStartupControls ( BOOL  bEnable)
static

Definition at line 23 of file generalpage.c.

Referenced by GeneralPageWndProc().

24 {
26 
29 
31 
32  // EnableWindow(GetDlgItem(hGeneralPage, IDC_RB_USE_ORIGINAL_BOOTCAT), bEnable);
33  // EnableWindow(GetDlgItem(hGeneralPage, IDC_RB_USE_MODIFIED_BOOTCAT), (bEnable ? !bIsOriginalBootIni : FALSE));
34 
37 
38  return;
39 }
#define IDC_CBX_LOAD_STARTUP_ITEMS
Definition: resource.h:28
#define assert(x)
Definition: debug.h:53
#define IDC_CBX_WIN_INI
Definition: resource.h:26
#define IDC_CBX_USE_ORIGINAL_BOOTCFG
Definition: resource.h:29
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDC_CBX_LOAD_SYSTEM_SERVICES
Definition: resource.h:27
#define IDC_CBX_SYSTEM_INI
Definition: resource.h:27
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND hGeneralPage
Definition: generalpage.c:12
_In_ BOOL bEnable
Definition: winddi.h:3426

◆ GeneralPageWndProc()

INT_PTR CALLBACK GeneralPageWndProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 55 of file generalpage.c.

56 {
58 
59  switch (message)
60  {
61  case WM_INITDIALOG:
62  {
63  hGeneralPage = hDlg;
65 
66  /* Search for the restore program and enable its button if needed */
70  else
72 
73 #if 0
74  /* FIXME */
77 #endif
78 
79  return TRUE;
80  }
81 
82  case WM_COMMAND:
83  {
84  switch (LOWORD(wParam))
85  {
87  {
88  /* Be sure that only this button is activated and the others are not */
90 
94 
96 
98  break;
99  }
100 
102  {
103  /* Be sure that only this button is activated and the others are not */
105 
108 
110  break;
111  }
112 
114  {
115  /* Be sure that only this button is activated and the others are not */
117 
120 
121  break;
122  }
123 
125  {
127 
130 
132 
133  break;
134  }
135 
137  {
138  // NOTE: 'err' variable defined for debugging purposes only.
140  if (err == ERROR_FILE_NOT_FOUND)
142 
143  break;
144  }
145 
148  break;
149 
150  default:
151  //break;
152  return FALSE;
153  }
154  break;
155  }
156 
157  case WM_NOTIFY:
158  {
159  switch (((LPNMHDR)lParam)->code)
160  {
161  case PSN_APPLY:
162  {
163  // TODO: Try to apply the modifications to the system.
165  return TRUE;
166  }
167 
168  case PSN_HELP:
169  {
170  MessageBoxW(hGeneralPage, L"Help not implemented yet!", L"Help", MB_ICONINFORMATION | MB_OK);
171  return TRUE;
172  }
173 
174  case PSN_KILLACTIVE: // Is going to lose activation.
175  {
176  // Changes are always valid of course.
178  return TRUE;
179  }
180 
181  case PSN_QUERYCANCEL:
182  {
183  // Allows cancellation.
185  return TRUE;
186  }
187 
189  {
190  // SetWindowLongPtr(hGeneralPage, DWLP_MSGRESULT,
191  // (LONG_PTR)GetDlgItem(hGeneralPage, (bIsOriginalBootIni ? IDC_RB_NORMAL_STARTUP : IDC_RB_SELECTIVE_STARTUP)));
192  return TRUE;
193  }
194 
195  //
196  // DO NOT TOUCH THESE NEXT MESSAGES, THEY ARE OK LIKE THIS...
197  //
198  case PSN_RESET: // Perform final cleaning, called before WM_DESTROY.
199  return TRUE;
200 
201  case PSN_SETACTIVE: // Is going to gain activation.
202  {
204  return TRUE;
205  }
206 
207  default:
208  break;
209  }
210 
211  return FALSE;
212  }
213 
214  default:
215  return FALSE;
216  }
217 
218  return FALSE;
219 }
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
DWORD RunCommand(IN LPCWSTR lpszCommand, IN LPCWSTR lpszParameters, IN INT nShowCmd)
Definition: utils.c:132
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define PSN_HELP
Definition: prsht.h:119
#define IDC_RB_DIAGNOSTIC_STARTUP
Definition: resource.h:23
#define IDC_RB_SELECTIVE_STARTUP
Definition: resource.h:24
VOID EnableCheckboxControls(HWND hDlg, BOOL bEnable)
Definition: generalpage.c:16
static LPCWSTR lpszRestoreProgPath1
Definition: generalpage.c:16
#define IDC_BTN_SYSTEM_RESTORE_START
Definition: resource.h:30
#define Button_Enable(hwndCtl, fEnable)
Definition: windowsx.h:5
#define SendDlgItemMessage
Definition: winuser.h:5708
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define IDC_RB_NORMAL_STARTUP
Definition: resource.h:22
#define PSN_KILLACTIVE
Definition: prsht.h:116
smooth NULL
Definition: ftsmooth.c:416
#define IDD_FILE_EXTRACT_DIALOG
Definition: resource.h:16
#define IDC_CBX_USE_ORIGINAL_BOOTCFG
Definition: resource.h:29
#define SW_SHOW
Definition: winuser.h:769
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
static BOOL bIsOriginalBootIni
Definition: generalpage.c:20
#define BM_SETCHECK
Definition: winuser.h:1882
static VOID EnableSelectiveStartupControls(BOOL bEnable)
Definition: generalpage.c:23
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:340
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MB_ICONINFORMATION
Definition: winuser.h:796
BOOL MyFileExists(IN LPCWSTR lpszFilePath, OUT PWIN32_FIND_DATAW pFindData OPTIONAL)
Definition: fileutils.c:18
static const WCHAR L[]
Definition: oid.c:1087
static VOID CheckSelectiveStartupControls(BOOL bCheck)
Definition: generalpage.c:41
static LPCWSTR lpszRestoreProgPath2
Definition: generalpage.c:17
#define err(...)
#define WM_COMMAND
Definition: winuser.h:1716
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
HWND hGeneralPage
Definition: generalpage.c:12
HINSTANCE hInst
Definition: dxdiag.c:13
#define IDC_BTN_FILE_EXTRACTION
Definition: resource.h:31
#define PSN_RESET
Definition: prsht.h:118
#define MB_OK
Definition: winuser.h:784
INT_PTR CALLBACK FileExtractDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
#define BST_CHECKED
Definition: winuser.h:197
#define Button_SetCheck(hwndCtl, check)
Definition: windowsx.h:10
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
#define WM_NOTIFY
Definition: richedit.h:61

Variable Documentation

◆ bIsOriginalBootIni

BOOL bIsOriginalBootIni = TRUE
static

Definition at line 20 of file generalpage.c.

Referenced by GeneralPageWndProc().

◆ hGeneralPage

HWND hGeneralPage = NULL
static

Definition at line 19 of file generalpage.c.

◆ lpszRestoreProgPath1

LPCWSTR lpszRestoreProgPath1 = L"%SystemRoot%\\System32\\rstrui.exe"
static

Definition at line 16 of file generalpage.c.

Referenced by GeneralPageWndProc().

◆ lpszRestoreProgPath2

LPCWSTR lpszRestoreProgPath2 = L"%SystemRoot%\\System32\\restore\\rstrui.exe"
static

Definition at line 17 of file generalpage.c.

Referenced by GeneralPageWndProc().