ReactOS 0.4.16-dev-197-g92996da
generalpage.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Applications
3 * LICENSE: LGPL - See COPYING in the top level directory
4 * FILE: base/applications/msconfig_new/generalpage.c
5 * PURPOSE: General page message handler
6 * COPYRIGHT: Copyright 2005-2006 Christoph von Wittich <Christoph@ApiViewer.de>
7 * Copyright 2011-2012 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr>
8 */
9
10#include "precomp.h"
11#include "fileutils.h"
12#include "utils.h"
13#include "comctl32supp.h"
14#include "fileextractdialog.h"
15
16static LPCWSTR lpszRestoreProgPath1 = L"%SystemRoot%\\System32\\rstrui.exe";
17static LPCWSTR lpszRestoreProgPath2 = L"%SystemRoot%\\System32\\restore\\rstrui.exe";
18
21// static BOOL bIsStartupNotModified = TRUE;
22
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}
40
42{
44
50
51 return;
52}
53
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.
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}
#define IDC_CBX_SYSTEM_INI
Definition: resource.h:27
BOOL MyFileExists(IN LPCWSTR lpszFilePath, OUT PWIN32_FIND_DATAW pFindData OPTIONAL)
Definition: fileutils.c:18
#define IDC_CBX_USE_ORIGINAL_BOOTCFG
Definition: resource.h:29
#define IDC_RB_NORMAL_STARTUP
Definition: resource.h:22
#define IDC_BTN_FILE_EXTRACTION
Definition: resource.h:31
#define IDC_CBX_LOAD_STARTUP_ITEMS
Definition: resource.h:28
#define IDC_RB_SELECTIVE_STARTUP
Definition: resource.h:24
#define IDC_CBX_LOAD_SYSTEM_SERVICES
Definition: resource.h:27
#define IDC_BTN_SYSTEM_RESTORE_START
Definition: resource.h:30
#define IDD_FILE_EXTRACT_DIALOG
Definition: resource.h:16
#define IDC_RB_DIAGNOSTIC_STARTUP
Definition: resource.h:23
#define IDC_CBX_WIN_INI
Definition: resource.h:26
DWORD RunCommand(IN LPCWSTR lpszCommand, IN LPCWSTR lpszParameters, IN INT nShowCmd)
Definition: utils.c:132
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
#define assert(x)
Definition: debug.h:53
HINSTANCE hInst
Definition: dxdiag.c:13
INT_PTR CALLBACK FileExtractDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
VOID EnableCheckboxControls(HWND hDlg, BOOL bEnable)
Definition: generalpage.c:16
HWND hGeneralPage
Definition: generalpage.c:12
INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: generalpage.c:25
static VOID EnableSelectiveStartupControls(BOOL bEnable)
Definition: generalpage.c:23
static BOOL bIsOriginalBootIni
Definition: generalpage.c:20
static VOID CheckSelectiveStartupControls(BOOL bCheck)
Definition: generalpage.c:41
static LPCWSTR lpszRestoreProgPath1
Definition: generalpage.c:16
static LPCWSTR lpszRestoreProgPath2
Definition: generalpage.c:17
unsigned int UINT
Definition: ndis.h:50
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define PropSheet_UnChanged(d, w)
Definition: prsht.h:358
#define PSN_KILLACTIVE
Definition: prsht.h:116
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_HELP
Definition: prsht.h:119
#define PSN_RESET
Definition: prsht.h:118
#define PSN_SETACTIVE
Definition: prsht.h:115
#define err(...)
#define WM_NOTIFY
Definition: richedit.h:61
Definition: inflate.c:139
Definition: tftpd.h:60
#define SetWindowLongPtr
Definition: treelist.c:70
int32_t INT_PTR
Definition: typedefs.h:64
_In_ BOOL bEnable
Definition: winddi.h:3426
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define Button_Enable(hwndCtl, fEnable)
Definition: windowsx.h:30
#define Button_SetCheck(hwndCtl, check)
Definition: windowsx.h:35
#define BST_UNCHECKED
Definition: winuser.h:199
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4402
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_INITDIALOG
Definition: winuser.h:1742
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define BM_SETCHECK
Definition: winuser.h:1924
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MB_OK
Definition: winuser.h:793
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define DWLP_MSGRESULT
Definition: winuser.h:873
#define MB_ICONINFORMATION
Definition: winuser.h:805
#define SW_SHOW
Definition: winuser.h:778
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SendDlgItemMessage
Definition: winuser.h:5854
#define BST_CHECKED
Definition: winuser.h:197
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185