ReactOS  0.4.12-dev-18-gf469aca
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 hDialogIcon = NULL
 

Macro Definition Documentation

◆ ETDT_DISABLE

#define ETDT_DISABLE   0x00000001

Definition at line 39 of file msconfig.c.

◆ ETDT_ENABLE

#define ETDT_ENABLE   0x00000002

Definition at line 40 of file msconfig.c.

◆ ETDT_ENABLETAB

#define ETDT_ENABLETAB   (ETDT_ENABLE | ETDT_USETABTEXTURE)

Definition at line 42 of file msconfig.c.

Referenced by EnableDialogTheme().

◆ ETDT_USETABTEXTURE

#define ETDT_USETABTEXTURE   0x00000004

Definition at line 41 of file msconfig.c.

Typedef Documentation

◆ ETDTProc

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

Definition at line 45 of file msconfig.c.

Function Documentation

◆ _tWinMain()

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

Definition at line 303 of file msconfig.c.

307 {
308 
310 
311  UNREFERENCED_PARAMETER(hPrevInstance);
312  UNREFERENCED_PARAMETER(lpCmdLine);
313  UNREFERENCED_PARAMETER(nCmdShow);
314 
315  InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
316  InitControls.dwICC = ICC_TAB_CLASSES | ICC_LISTVIEW_CLASSES;
317  InitCommonControlsEx(&InitControls);
318 
319  hInst = hInstance;
320 
322 
323  return 0;
324 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
HINSTANCE hInst
Definition: msconfig.c:19
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:297
#define DialogBox
Definition: winuser.h:5627
HINSTANCE hInstance
Definition: charmap.c:20
smooth NULL
Definition: ftsmooth.c:416
#define IDD_MSCONFIG_DIALOG
Definition: resource.h:3
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
INT_PTR CALLBACK MsConfigWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msconfig.c:223
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define ICC_TAB_CLASSES
Definition: commctrl.h:61

◆ EnableDialogTheme()

BOOL EnableDialogTheme ( HWND  hwnd)

Definition at line 50 of file msconfig.c.

Referenced by OnCreate().

51 {
52  HMODULE hUXTheme;
54 
55  hUXTheme = LoadLibrary(_T("uxtheme.dll"));
56 
57  if(hUXTheme)
58  {
59  fnEnableThemeDialogTexture =
60  (ETDTProc)GetProcAddress(hUXTheme, "EnableThemeDialogTexture");
61 
62  if(fnEnableThemeDialogTexture)
63  {
65 
66  FreeLibrary(hUXTheme);
67  return TRUE;
68  }
69  else
70  {
71  // Failed to locate API!
72  FreeLibrary(hUXTheme);
73  return FALSE;
74  }
75  }
76  else
77  {
78  // Not running under XP? Just fail gracefully
79  return FALSE;
80  }
81 }
#define TRUE
Definition: types.h:120
#define LoadLibrary
Definition: winbase.h:3676
#define ETDT_ENABLETAB
Definition: msconfig.c:42
#define _T(x)
Definition: vfdio.h:22
#define FreeLibrary(x)
Definition: compat.h:405
static ETDTProc fnEnableThemeDialogTexture
Definition: uxthemesupp.c:15
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: msconfig.c:45
#define GetProcAddress(x, y)
Definition: compat.h:410

◆ MsConfig_OnTabWndSelChange()

void MsConfig_OnTabWndSelChange ( void  )

Definition at line 141 of file msconfig.c.

Referenced by MsConfigWndProc(), and OnCreate().

142 {
143  switch (TabCtrl_GetCurSel(hTabWnd)) {
144  case 0: //General
152  break;
153  case 1: //SYSTEM.INI
161  break;
162  case 2: //Freeldr
170  break;
171  case 3: //Services
179  break;
180  case 4: //startup
188  break;
189  case 5: //Tools
197  break;
198  }
199 }
#define SW_HIDE
Definition: winuser.h:762
#define TabCtrl_GetCurSel(hwnd)
Definition: commctrl.h:4030
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND hSystemPage
Definition: systempage.c:12
HWND hTabWnd
Definition: msconfig.c:22
BOOL WINAPI BringWindowToTop(_In_ HWND)
#define SW_SHOW
Definition: winuser.h:769
HWND hServicesPage
Definition: srvpage.c:15
HWND hFreeLdrPage
Definition: freeldrpage.c:12
HWND hGeneralPage
Definition: generalpage.c:12
HWND hToolsPage
Definition: toolspage.c:14
HWND hStartupPage
Definition: startuppage.c:12

◆ MsConfigWndProc()

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

Definition at line 223 of file msconfig.c.

Referenced by _tWinMain().

224 {
225  LPNMHDR pnmh;
226  UINT uXIconNew, uYIconNew;
227 
228  switch (message)
229  {
230  case WM_INITDIALOG:
231  hMainWnd = hDlg;
232 
235 
236  SetDialogIcon(hDlg);
237 
238  return OnCreate(hDlg);
239 
240  case WM_SETTINGCHANGE:
241  uXIconNew = GetSystemMetrics(SM_CXSMICON);
242  uYIconNew = GetSystemMetrics(SM_CYSMICON);
243 
244  if ((uXIcon != uXIconNew) || (uYIcon != uYIconNew))
245  {
246  uXIcon = uXIconNew;
247  uYIcon = uYIconNew;
248  SetDialogIcon(hDlg);
249  }
250  break;
251 
252  case WM_COMMAND:
253 
254  if (LOWORD(wParam) == IDOK)
255  {
256  //MsConfig_OnSaveChanges();
257  }
258 
259  if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
260  EndDialog(hDlg, LOWORD(wParam));
261  return TRUE;
262  }
263  break;
264 
265  case WM_NOTIFY:
266  pnmh = (LPNMHDR)lParam;
267  if ((pnmh->hwndFrom == hTabWnd) &&
268  (pnmh->idFrom == IDC_TAB) &&
269  (pnmh->code == TCN_SELCHANGE))
270  {
272  }
273  break;
274 
275  case WM_SYSCOLORCHANGE:
276  /* Forward WM_SYSCOLORCHANGE to common controls */
280  break;
281 
282  case WM_DESTROY:
283  if (hToolsPage)
285  if (hGeneralPage)
287  if (hServicesPage)
289  if (hStartupPage)
291  if (hFreeLdrPage)
293  if (hSystemPage)
295  if (hDialogIcon)
297  return DefWindowProc(hDlg, message, wParam, lParam);
298  }
299 
300  return 0;
301 }
UINT uYIcon
Definition: msconfig.c:23
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define IDC_TAB
Definition: resource.h:12
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define SM_CYSMICON
Definition: winuser.h:1003
static VOID SetDialogIcon(HWND hDlg)
Definition: msconfig.c:204
HWND hSystemPage
Definition: systempage.c:12
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
HWND hToolsListCtrl
Definition: toolspage.c:15
struct tagNMHDR * LPNMHDR
#define WM_SETTINGCHANGE
Definition: winuser.h:1611
HWND hMainWnd
Definition: msconfig.c:21
UINT code
Definition: winuser.h:3112
HWND hTabWnd
Definition: msconfig.c:22
UINT_PTR idFrom
Definition: winuser.h:3111
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
HICON hDialogIcon
Definition: msconfig.c:24
#define TCN_SELCHANGE
Definition: commctrl.h:4099
unsigned int UINT
Definition: ndis.h:50
int WINAPI GetSystemMetrics(_In_ int)
void MsConfig_OnTabWndSelChange(void)
Definition: msconfig.c:141
HWND hServicesPage
Definition: srvpage.c:15
#define SM_CXSMICON
Definition: winuser.h:1002
#define WM_COMMAND
Definition: winuser.h:1716
HWND hwndFrom
Definition: winuser.h:3110
HWND hFreeLdrPage
Definition: freeldrpage.c:12
HWND hServicesListCtrl
Definition: srvpage.c:16
HWND hGeneralPage
Definition: generalpage.c:12
HWND hToolsPage
Definition: toolspage.c:14
#define SendMessage
Definition: winuser.h:5709
HWND hStartupPage
Definition: startuppage.c:12
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
HWND hStartupListCtrl
Definition: startuppage.c:13
UINT uXIcon
Definition: msconfig.c:23
#define WM_NOTIFY
Definition: richedit.h:61
BOOL OnCreate(HWND hWnd)
Definition: msconfig.c:82

◆ OnCreate()

BOOL OnCreate ( HWND  hWnd)

Definition at line 82 of file msconfig.c.

Referenced by CSysPagerWnd::ContextSensitiveHelp(), CTaskSwitchWnd::ContextSensitiveHelp(), CGridView::GetHwnd(), CShellBrowser::GetWindowProc(), MsConfigWndProc(), and CShellBrowser::OnCreate().

83 {
84  TCHAR szTemp[256];
85  TCITEM item;
86 
87  hTabWnd = GetDlgItem(hWnd, IDC_TAB);
94 
95  LoadString(hInst, IDS_MSCONFIG, szTemp, 256);
96  SetWindowText(hWnd, szTemp);
97 
98  // Insert Tab Pages
99  LoadString(hInst, IDS_TAB_GENERAL, szTemp, 256);
100  memset(&item, 0, sizeof(TCITEM));
101  item.mask = TCIF_TEXT;
102  item.pszText = szTemp;
103  (void)TabCtrl_InsertItem(hTabWnd, 0, &item);
104 
105  LoadString(hInst, IDS_TAB_SYSTEM, szTemp, 256);
106  memset(&item, 0, sizeof(TCITEM));
107  item.mask = TCIF_TEXT;
108  item.pszText = szTemp;
109  (void)TabCtrl_InsertItem(hTabWnd, 1, &item);
110 
111  LoadString(hInst, IDS_TAB_FREELDR, szTemp, 256);
112  memset(&item, 0, sizeof(TCITEM));
113  item.mask = TCIF_TEXT;
114  item.pszText = szTemp;
115  (void)TabCtrl_InsertItem(hTabWnd, 2, &item);
116 
117  LoadString(hInst, IDS_TAB_SERVICES, szTemp, 256);
118  memset(&item, 0, sizeof(TCITEM));
119  item.mask = TCIF_TEXT;
120  item.pszText = szTemp;
121  (void)TabCtrl_InsertItem(hTabWnd, 3, &item);
122 
123  LoadString(hInst, IDS_TAB_STARTUP, szTemp, 256);
124  memset(&item, 0, sizeof(TCITEM));
125  item.mask = TCIF_TEXT;
126  item.pszText = szTemp;
127  (void)TabCtrl_InsertItem(hTabWnd, 4, &item);
128 
129  LoadString(hInst, IDS_TAB_TOOLS, szTemp, 256);
130  memset(&item, 0, sizeof(TCITEM));
131  item.mask = TCIF_TEXT;
132  item.pszText = szTemp;
133  (void)TabCtrl_InsertItem(hTabWnd, 5, &item);
134 
136 
137  return TRUE;
138 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define IDC_TAB
Definition: resource.h:12
HINSTANCE hInst
Definition: msconfig.c:19
#define IDS_TAB_TOOLS
Definition: resource.h:72
INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: srvpage.c:22
#define TCIF_TEXT
Definition: commctrl.h:3938
HWND hSystemPage
Definition: systempage.c:12
#define IDD_TOOLS_PAGE
Definition: resource.h:4
INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: system.c:383
#define IDS_TAB_GENERAL
Definition: resource.h:77
#define IDD_SYSTEM_PAGE
Definition: resource.h:9
HWND hTabWnd
Definition: msconfig.c:22
#define IDS_TAB_SERVICES
Definition: resource.h:76
BOOL EnableDialogTheme(HWND hwnd)
Definition: msconfig.c:50
char TCHAR
Definition: xmlstorage.h:189
INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: freeldrpage.c:134
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDS_TAB_STARTUP
Definition: resource.h:75
void MsConfig_OnTabWndSelChange(void)
Definition: msconfig.c:141
#define IDS_MSCONFIG
Definition: resource.h:114
HWND hServicesPage
Definition: srvpage.c:15
#define IDS_TAB_SYSTEM
Definition: resource.h:73
#define IDS_TAB_FREELDR
Definition: resource.h:74
HWND hFreeLdrPage
Definition: freeldrpage.c:12
#define IDD_GENERAL_PAGE
Definition: resource.h:6
HWND hGeneralPage
Definition: generalpage.c:12
#define IDD_SERVICES_PAGE
Definition: resource.h:5
static ATOM item
Definition: dde.c:856
HWND hToolsPage
Definition: toolspage.c:14
#define SetWindowText
Definition: winuser.h:5723
INT_PTR CALLBACK ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: toolspage.c:56
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
Definition: commctrl.h:4018
HWND hStartupPage
Definition: startuppage.c:12
INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: startuppage.c:20
#define TCITEM
Definition: commctrl.h:3996
#define IDD_FREELDR_PAGE
Definition: resource.h:8
#define IDD_STARTUP_PAGE
Definition: resource.h:7
#define memset(x, y, z)
Definition: compat.h:39
INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: generalpage.c:25
#define LoadString
Definition: winuser.h:5685
#define CreateDialog
Definition: winuser.h:5615

◆ SetDialogIcon()

static VOID SetDialogIcon ( HWND  hDlg)
static

Definition at line 204 of file msconfig.c.

Referenced by MsConfigWndProc().

205 {
207 
210  IMAGE_ICON,
211  uXIcon,
212  uYIcon,
213  0);
214  SendMessage(hDlg,
215  WM_SETICON,
216  ICON_SMALL,
218 }
UINT uYIcon
Definition: msconfig.c:23
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define ICON_SMALL
Definition: tnclass.cpp:48
LONG_PTR LPARAM
Definition: windef.h:208
smooth NULL
Definition: ftsmooth.c:416
HICON hDialogIcon
Definition: msconfig.c:24
#define IDI_APPICON
Definition: resource.h:166
#define GetModuleHandle
Definition: winbase.h:3641
#define SendMessage
Definition: winuser.h:5709
#define LoadImage
Definition: winuser.h:5681
UINT uXIcon
Definition: msconfig.c:23

Variable Documentation

◆ hDialogIcon

HICON hDialogIcon = NULL

Definition at line 24 of file msconfig.c.

Referenced by MsConfigWndProc(), and SetDialogIcon().

◆ hInst

HINSTANCE hInst = 0

Definition at line 19 of file msconfig.c.

◆ hMainWnd

HWND hMainWnd

Definition at line 21 of file msconfig.c.

◆ hTabWnd

HWND hTabWnd

Definition at line 22 of file msconfig.c.

Referenced by ApplicationPage_OnGotoProcess(), ApplicationPageUpdate(), and tabstops_proc().

◆ 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().