ReactOS 0.4.16-dev-336-gb667d82
msconfig.c File Reference
#include "precomp.h"
#include "toolspage.h"
#include "srvpage.h"
#include "startuppage.h"
#include "freeldrpage.h"
#include "systempage.h"
#include "generalpage.h"
Include dependency graph for msconfig.c:

Go to the source code of this file.

Macros

#define ETDT_DISABLE   0x00000001
 
#define ETDT_ENABLE   0x00000002
 
#define ETDT_USETABTEXTURE   0x00000004
 
#define ETDT_ENABLETAB   (ETDT_ENABLE | ETDT_USETABTEXTURE)
 

Typedefs

typedef HRESULT(WINAPIETDTProc) (HWND, DWORD)
 

Functions

void MsConfig_OnTabWndSelChange (void)
 
BOOL EnableDialogTheme (HWND hwnd)
 
BOOL OnCreate (HWND hWnd)
 
static VOID SetDialogIcon (HWND hDlg)
 
INT_PTR CALLBACK MsConfigWndProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
int APIENTRY _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
 

Variables

HINSTANCE hInst = 0
 
HWND hMainWnd
 
HWND hTabWnd
 
UINT uXIcon = 0
 
UINT uYIcon = 0
 
HICON hDialogIconBig = NULL
 
HICON hDialogIconSmall = NULL
 

Macro Definition Documentation

◆ ETDT_DISABLE

#define ETDT_DISABLE   0x00000001

Definition at line 40 of file msconfig.c.

◆ ETDT_ENABLE

#define ETDT_ENABLE   0x00000002

Definition at line 41 of file msconfig.c.

◆ ETDT_ENABLETAB

#define ETDT_ENABLETAB   (ETDT_ENABLE | ETDT_USETABTEXTURE)

Definition at line 43 of file msconfig.c.

◆ ETDT_USETABTEXTURE

#define ETDT_USETABTEXTURE   0x00000004

Definition at line 42 of file msconfig.c.

Typedef Documentation

◆ ETDTProc

typedef HRESULT(WINAPI * ETDTProc) (HWND, DWORD)

Definition at line 46 of file msconfig.c.

Function Documentation

◆ _tWinMain()

int APIENTRY _tWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPTSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 313 of file msconfig.c.

317{
318
320
321 UNREFERENCED_PARAMETER(hPrevInstance);
322 UNREFERENCED_PARAMETER(lpCmdLine);
323 UNREFERENCED_PARAMETER(nCmdShow);
324
325 InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
328
330
332
333 return 0;
334}
#define IDD_MSCONFIG_DIALOG
Definition: resource.h:3
HINSTANCE hInstance
Definition: charmap.c:19
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define NULL
Definition: types.h:112
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
INT_PTR CALLBACK MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msconfig.c:231
HINSTANCE hInst
Definition: msconfig.c:19
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_TAB_CLASSES
Definition: commctrl.h:61
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define DialogBox
Definition: winuser.h:5773
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

◆ EnableDialogTheme()

BOOL EnableDialogTheme ( HWND  hwnd)

Definition at line 51 of file msconfig.c.

52{
53 HMODULE hUXTheme;
55
56 hUXTheme = LoadLibrary(_T("uxtheme.dll"));
57
58 if(hUXTheme)
59 {
61 (ETDTProc)GetProcAddress(hUXTheme, "EnableThemeDialogTexture");
62
64 {
66
67 FreeLibrary(hUXTheme);
68 return TRUE;
69 }
70 else
71 {
72 // Failed to locate API!
73 FreeLibrary(hUXTheme);
74 return FALSE;
75 }
76 }
77 else
78 {
79 // Not running under XP? Just fail gracefully
80 return FALSE;
81 }
82}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: msconfig.c:46
#define ETDT_ENABLETAB
Definition: msconfig.c:43
static ETDTProc fnEnableThemeDialogTexture
Definition: uxthemesupp.c:15
#define _T(x)
Definition: vfdio.h:22
#define LoadLibrary
Definition: winbase.h:3887
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by OnCreate().

◆ MsConfig_OnTabWndSelChange()

void MsConfig_OnTabWndSelChange ( void  )

Definition at line 142 of file msconfig.c.

143{
144 switch (TabCtrl_GetCurSel(hTabWnd)) {
145 case 0: //General
153 break;
154 case 1: //SYSTEM.INI
162 break;
163 case 2: //Freeldr
171 break;
172 case 3: //Services
180 break;
181 case 4: //startup
189 break;
190 case 5: //Tools
198 break;
199 }
200}
HWND hFreeLdrPage
Definition: freeldrpage.c:12
HWND hGeneralPage
Definition: generalpage.c:12
HWND hTabWnd
Definition: msconfig.c:22
HWND hStartupPage
Definition: startuppage.c:12
HWND hSystemPage
Definition: systempage.c:12
#define TabCtrl_GetCurSel(hwnd)
Definition: commctrl.h:4068
HWND hServicesPage
Definition: srvpage.c:15
HWND hToolsPage
Definition: toolspage.c:14
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:778
BOOL WINAPI BringWindowToTop(_In_ HWND)

Referenced by MsConfigWndProc(), and OnCreate().

◆ MsConfigWndProc()

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

Definition at line 231 of file msconfig.c.

232{
233 LPNMHDR pnmh;
234 UINT uXIconNew, uYIconNew;
235
236 switch (message)
237 {
238 case WM_INITDIALOG:
239 hMainWnd = hDlg;
240
243
244 SetDialogIcon(hDlg);
245
246 return OnCreate(hDlg);
247
248 case WM_SETTINGCHANGE:
249 uXIconNew = GetSystemMetrics(SM_CXSMICON);
250 uYIconNew = GetSystemMetrics(SM_CYSMICON);
251
252 if ((uXIcon != uXIconNew) || (uYIcon != uYIconNew))
253 {
254 uXIcon = uXIconNew;
255 uYIcon = uYIconNew;
256 SetDialogIcon(hDlg);
257 }
258 break;
259
260 case WM_COMMAND:
261
262 if (LOWORD(wParam) == IDOK)
263 {
264 //MsConfig_OnSaveChanges();
265 }
266
267 if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
268 EndDialog(hDlg, LOWORD(wParam));
269 return TRUE;
270 }
271 break;
272
273 case WM_NOTIFY:
274 pnmh = (LPNMHDR)lParam;
275 if ((pnmh->hwndFrom == hTabWnd) &&
276 (pnmh->idFrom == IDC_TAB) &&
277 (pnmh->code == TCN_SELCHANGE))
278 {
280 }
281 break;
282
284 /* Forward WM_SYSCOLORCHANGE to common controls */
288 break;
289
290 case WM_DESTROY:
291 if (hToolsPage)
293 if (hGeneralPage)
295 if (hServicesPage)
297 if (hStartupPage)
299 if (hFreeLdrPage)
301 if (hSystemPage)
303 if (hDialogIconBig)
307 return DefWindowProc(hDlg, message, wParam, lParam);
308 }
309
310 return 0;
311}
#define IDC_TAB
Definition: resource.h:12
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL OnCreate(HWND hWnd)
Definition: msconfig.c:83
HICON hDialogIconSmall
Definition: msconfig.c:25
HWND hMainWnd
Definition: msconfig.c:21
UINT uYIcon
Definition: msconfig.c:23
void MsConfig_OnTabWndSelChange(void)
Definition: msconfig.c:142
UINT uXIcon
Definition: msconfig.c:23
HICON hDialogIconBig
Definition: msconfig.c:24
static VOID SetDialogIcon(HWND hDlg)
Definition: msconfig.c:205
HWND hStartupListCtrl
Definition: startuppage.c:13
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define TCN_SELCHANGE
Definition: commctrl.h:4137
#define WM_NOTIFY
Definition: richedit.h:61
#define DefWindowProc
Definition: ros2win.h:31
HWND hServicesListCtrl
Definition: srvpage.c:16
Definition: tftpd.h:60
UINT_PTR idFrom
Definition: winuser.h:3161
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
HWND hToolsListCtrl
Definition: toolspage.c:15
#define IDCANCEL
Definition: winuser.h:834
#define WM_COMMAND
Definition: winuser.h:1743
#define SM_CYSMICON
Definition: winuser.h:1016
#define WM_INITDIALOG
Definition: winuser.h:1742
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
#define IDOK
Definition: winuser.h:833
#define WM_SETTINGCHANGE
Definition: winuser.h:1632
#define SM_CXSMICON
Definition: winuser.h:1015
struct tagNMHDR * LPNMHDR
#define SendMessage
Definition: winuser.h:5855
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105

Referenced by _tWinMain().

◆ OnCreate()

BOOL OnCreate ( HWND  hWnd)

Definition at line 83 of file msconfig.c.

84{
85 TCHAR szTemp[256];
87
95
96 LoadString(hInst, IDS_MSCONFIG, szTemp, 256);
97 SetWindowText(hWnd, szTemp);
98
99 // Insert Tab Pages
100 LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256);
101 memset(&item, 0, sizeof(TCITEM));
102 item.mask = TCIF_TEXT;
103 item.pszText = szTemp;
105
106 LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256);
107 memset(&item, 0, sizeof(TCITEM));
108 item.mask = TCIF_TEXT;
109 item.pszText = szTemp;
111
112 LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
113 memset(&item, 0, sizeof(TCITEM));
114 item.mask = TCIF_TEXT;
115 item.pszText = szTemp;
117
118 LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
119 memset(&item, 0, sizeof(TCITEM));
120 item.mask = TCIF_TEXT;
121 item.pszText = szTemp;
123
124 LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
125 memset(&item, 0, sizeof(TCITEM));
126 item.mask = TCIF_TEXT;
127 item.pszText = szTemp;
129
130 LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
131 memset(&item, 0, sizeof(TCITEM));
132 item.mask = TCIF_TEXT;
133 item.pszText = szTemp;
135
137
138 return TRUE;
139}
HWND hWnd
Definition: settings.c:17
INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: system.c:393
#define IDD_GENERAL_PAGE
Definition: resource.h:6
#define IDS_TAB_TOOLS
Definition: resource.h:72
#define IDD_FREELDR_PAGE
Definition: resource.h:8
#define IDD_TOOLS_PAGE
Definition: resource.h:4
#define IDS_TAB_FREELDR
Definition: resource.h:74
#define IDD_STARTUP_PAGE
Definition: resource.h:7
#define IDS_TAB_STARTUP
Definition: resource.h:75
#define IDD_SERVICES_PAGE
Definition: resource.h:5
#define IDD_SYSTEM_PAGE
Definition: resource.h:9
#define IDS_MSCONFIG
Definition: resource.h:114
#define IDS_TAB_GENERAL
Definition: resource.h:77
#define IDS_TAB_SERVICES
Definition: resource.h:76
#define IDS_TAB_SYSTEM
Definition: resource.h:73
static ATOM item
Definition: dde.c:856
INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: freeldrpage.c:134
INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: generalpage.c:25
BOOL EnableDialogTheme(HWND hwnd)
Definition: msconfig.c:51
INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: startuppage.c:20
#define TCITEM
Definition: commctrl.h:4034
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
Definition: commctrl.h:4056
#define TCIF_TEXT
Definition: commctrl.h:3976
#define memset(x, y, z)
Definition: compat.h:39
INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: srvpage.c:22
INT_PTR CALLBACK ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: toolspage.c:56
#define CreateDialog
Definition: winuser.h:5761
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LoadString
Definition: winuser.h:5831
#define SetWindowText
Definition: winuser.h:5869
#define MAKEINTRESOURCE
Definition: winuser.h:591
char TCHAR
Definition: xmlstorage.h:189

Referenced by MsConfigWndProc().

◆ SetDialogIcon()

static VOID SetDialogIcon ( HWND  hDlg)
static

Definition at line 205 of file msconfig.c.

206{
209
215 uXIcon,
216 uYIcon,
217 0);
218 SendMessage(hDlg,
219 WM_SETICON,
220 ICON_BIG,
222 SendMessage(hDlg,
223 WM_SETICON,
226}
#define IDI_APPICON
Definition: resource.h:166
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
#define GetModuleHandle
Definition: winbase.h:3852
LONG_PTR LPARAM
Definition: windef.h:208
#define IMAGE_ICON
Definition: winuser.h:212
#define LoadImage
Definition: winuser.h:5827
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127

Referenced by MsConfigWndProc().

Variable Documentation

◆ hDialogIconBig

HICON hDialogIconBig = NULL

Definition at line 24 of file msconfig.c.

Referenced by MsConfigWndProc(), and SetDialogIcon().

◆ hDialogIconSmall

HICON hDialogIconSmall = NULL

Definition at line 25 of file msconfig.c.

Referenced by MsConfigWndProc(), and SetDialogIcon().

◆ hInst

HINSTANCE hInst = 0

Definition at line 19 of file msconfig.c.

Referenced by _tWinMain(), Initialize(), MainWndProc(), OnCreate(), and PropSheetCallback().

◆ hMainWnd

HWND hMainWnd

Definition at line 21 of file msconfig.c.

Referenced by _tWinMain(), and MsConfigWndProc().

◆ hTabWnd

◆ uXIcon

UINT uXIcon = 0

Definition at line 23 of file msconfig.c.

Referenced by MsConfigWndProc(), and SetDialogIcon().

◆ uYIcon

UINT uYIcon = 0

Definition at line 23 of file msconfig.c.

Referenced by MsConfigWndProc(), and SetDialogIcon().