ReactOS  0.4.12-dev-75-g00dd17e
msconfig.c File Reference
#include "precomp.h"
#include "fileutils.h"
#include "utils.h"
#include "generalpage.h"
#include "systempage.h"
#include "freeldrpage.h"
#include "srvpage.h"
#include "toolspage.h"
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for msconfig.c:

Go to the source code of this file.

Classes

struct  DLGTEMPLATEEX
 

Typedefs

typedef struct DLGTEMPLATEEX DLGTEMPLATEEX
 
typedef struct DLGTEMPLATEEXLPDLGTEMPLATEEX
 

Functions

HWND hSingleWnd __attribute__ ((section("MSConfigInstance"), shared))
 
INT_PTR CALLBACK About (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
 
int CALLBACK PropSheetCallback (HWND hDlg, UINT message, LPARAM lParam)
 
HWND CreatePropSheet (HINSTANCE hInstance, HWND hwndOwner, LPCTSTR lpszTitle)
 
BOOL Initialize (HINSTANCE hInstance)
 
VOID Cleanup (VOID)
 
int APIENTRY _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
 

Variables

BOOL bIsWindows = FALSE
 
BOOL bIsPreVistaOSVersion = TRUE
 
const LPCWSTR IDS_REACTOS = L"ReactOS"
 
const LPCWSTR IDS_MICROSOFT = L"Microsoft"
 
const LPCWSTR IDS_WINDOWS = L"Windows"
 
HINSTANCE hInst = NULL
 
LPWSTR szAppName = NULL
 
HWND hMainWnd
 
HWND hTabWnd
 
HICON hIcon = NULL
 
HICON hIconSm = NULL
 
WNDPROC wpOrigEditProc = NULL
 

Typedef Documentation

◆ DLGTEMPLATEEX

◆ LPDLGTEMPLATEEX

Function Documentation

◆ __attribute__()

HWND hSingleWnd __attribute__ ( (section("MSConfigInstance"), shared)  )

◆ _tWinMain()

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

Definition at line 407 of file msconfig.c.

411 {
412  MSG msg;
413  HACCEL hAccelTable;
414 
415  UNREFERENCED_PARAMETER(hPrevInstance);
416  UNREFERENCED_PARAMETER(lpCmdLine);
417  UNREFERENCED_PARAMETER(nCmdShow);
418 
419  /*
420  * Initialize this instance of MSConfig. Quit if we have
421  * another instance already running.
422  */
423  if (!Initialize(hInstance))
424  return -1;
425 
426  // hInst = hInstance;
427 
428  hMainWnd = CreatePropSheet(hInstance, NULL, szAppName);
429  if (!hMainWnd)
430  {
431  /* We failed, cleanup and bail out */
432  Cleanup();
433  return -1;
434  }
435 
436  hAccelTable = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(IDR_MSCONFIG));
437 
438  /* Message loop */
439  while (IsWindow(hMainWnd) && GetMessageW(&msg, NULL, 0, 0))
440  {
441  /*
442  * PropSheet_GetCurrentPageHwnd returns NULL when the user clicks the OK or Cancel button
443  * and after all of the pages have been notified. Apply button doesn't cause this to happen.
444  * We can then use the DestroyWindow function to destroy the property sheet.
445  */
447  break;
448 
449  /* Process the accelerator table */
450  if (!TranslateAcceleratorW(hMainWnd, hAccelTable, &msg))
451  {
452  /*
453  * If e.g. an item on the tree view is being edited,
454  * we cannot pass the event to PropSheet_IsDialogMessage.
455  * Doing so causes the property sheet to be closed at Enter press
456  * (instead of completing edit operation).
457  */
458  if (/*g_bDisableDialogDispatch ||*/ !PropSheet_IsDialogMessage(hMainWnd, &msg))
459  {
460  TranslateMessage(&msg);
461  DispatchMessageW(&msg);
462  }
463  }
464  }
465 
466  // FIXME: Process the results of MSConfig !!
467 
468  /* Destroy the accelerator table and the window */
469  if (hAccelTable != NULL)
470  DestroyAcceleratorTable(hAccelTable);
471 
473 
474  /* Finish cleanup and return */
475  Cleanup();
476  return (int)msg.wParam;
477 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define PropSheet_IsDialogMessage(d, m)
Definition: prsht.h:329
#define PropSheet_GetCurrentPageHwnd(d)
Definition: prsht.h:327
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
HWND CreatePropSheet(HINSTANCE hInstance, HWND hwndOwner, LPCTSTR lpszTitle)
Definition: msconfig.c:209
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IDR_MSCONFIG
Definition: resource.h:154
HWND hMainWnd
Definition: msconfig.c:21
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
LPWSTR szAppName
Definition: msconfig.c:40
VOID Cleanup(VOID)
Definition: msconfig.c:399
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
BOOL Initialize(HINSTANCE hInstance)
Definition: msconfig.c:341
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define msg(x)
Definition: auth_time.c:54
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ About()

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

Definition at line 49 of file msconfig.c.

Referenced by MainWndProc().

50 {
52  switch (message)
53  {
54  case WM_INITDIALOG:
55  return (INT_PTR)TRUE;
56 
57  case WM_COMMAND:
58  if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
59  {
60  EndDialog(hDlg, LOWORD(wParam));
61  return (INT_PTR)TRUE;
62  }
63  break;
64  }
65  return (INT_PTR)FALSE;
66 }
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
int32_t INT_PTR
Definition: typedefs.h:62
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define WM_COMMAND
Definition: winuser.h:1716
#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

◆ Cleanup()

VOID Cleanup ( VOID  )

Definition at line 399 of file msconfig.c.

Referenced by _tWinMain().

400 {
402 
403  // // Close the sentry semaphore.
404  // CloseHandle(hSemaphore);
405 }
BOOL MemFree(IN PVOID lpMem)
Definition: utils.c:26
LPWSTR szAppName
Definition: msconfig.c:40

◆ CreatePropSheet()

HWND CreatePropSheet ( HINSTANCE  hInstance,
HWND  hwndOwner,
LPCTSTR  lpszTitle 
)

Definition at line 209 of file msconfig.c.

Referenced by _tWinMain().

210 {
211  HWND hPropSheet;
212  PROPSHEETHEADERW psh;
213  PROPSHEETPAGEW psp[7];
214  unsigned int nPages = 0;
215 
216  /* Header */
217  psh.dwSize = sizeof(psh);
218  psh.dwFlags = PSH_PROPSHEETPAGE | PSH_MODELESS | /*PSH_USEICONID |*/ PSH_HASHELP | /*PSH_NOCONTEXTHELP |*/ PSH_USECALLBACK;
219  psh.hInstance = hInstance;
220  psh.hwndParent = hwndOwner;
221  // psh.pszIcon = MAKEINTRESOURCEW(IDI_APPICON); // Disabled because it only sets the small icon; the big icon is a stretched version of the small one.
222  psh.pszCaption = lpszTitle;
223  psh.nStartPage = 0;
224  psh.ppsp = psp;
226 
227  /* General page */
228  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
229  psp[nPages].dwFlags = PSP_HASHELP;
230  psp[nPages].hInstance = hInstance;
232  psp[nPages].pfnDlgProc = GeneralPageWndProc;
233  ++nPages;
234 
235  // if (bIsPreVistaOSVersion)
236  {
237  /* SYSTEM.INI page */
239  {
240  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
241  psp[nPages].dwFlags = PSP_HASHELP | PSP_USETITLE;
242  psp[nPages].hInstance = hInstance;
245  psp[nPages].pfnDlgProc = SystemPageWndProc;
246  psp[nPages].lParam = (LPARAM)lpszSystemIni;
247  ++nPages;
248 
250  }
251 
252  /* WIN.INI page */
254  {
255  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
256  psp[nPages].dwFlags = PSP_HASHELP | PSP_USETITLE;
257  psp[nPages].hInstance = hInstance;
258  psp[nPages].pszTitle = MAKEINTRESOURCEW(IDS_TAB_WIN);
260  psp[nPages].pfnDlgProc = WinPageWndProc;
261  psp[nPages].lParam = (LPARAM)lpszWinIni;
262  ++nPages;
263 
265  }
266  }
267 
268  /* FreeLdr page */
269  // TODO: Program the interface for Vista: "light" BCD editor...
271  {
272  LPCWSTR lpszLoaderIniFile = NULL;
273  DWORD dwTabNameId = 0;
274  if (bIsWindows)
275  {
276  lpszLoaderIniFile = lpszBootIni;
277  dwTabNameId = IDS_TAB_BOOT;
278  }
279  else
280  {
281  lpszLoaderIniFile = lpszFreeLdrIni;
282  dwTabNameId = IDS_TAB_FREELDR;
283  }
284 
285  if (MyFileExists(lpszLoaderIniFile, NULL))
286  {
287  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
288  psp[nPages].dwFlags = PSP_HASHELP | PSP_USETITLE;
289  psp[nPages].hInstance = hInstance;
290  psp[nPages].pszTitle = MAKEINTRESOURCEW(dwTabNameId);
292  psp[nPages].pfnDlgProc = FreeLdrPageWndProc;
293  psp[nPages].lParam = (LPARAM)lpszLoaderIniFile;
294  ++nPages;
295 
296  BackupIniFile(lpszLoaderIniFile);
297  }
298  }
299 
300  /* Services page */
301  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
302  psp[nPages].dwFlags = PSP_HASHELP;
303  psp[nPages].hInstance = hInstance;
305  psp[nPages].pfnDlgProc = ServicesPageWndProc;
306  ++nPages;
307 
308 #if 0
309  /* Startup page */
310  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
311  psp[nPages].dwFlags = PSP_HASHELP;
312  psp[nPages].hInstance = hInstance;
314  psp[nPages].pfnDlgProc = StartupPageWndProc;
315  ++nPages;
316 #endif
317 
318  /* Tools page */
319  psp[nPages].dwSize = sizeof(PROPSHEETPAGEW);
320  psp[nPages].dwFlags = PSP_HASHELP;
321  psp[nPages].hInstance = hInstance;
323  psp[nPages].pfnDlgProc = ToolsPageWndProc;
324  ++nPages;
325 
326  /* Set the total number of created pages */
327  psh.nPages = nPages;
328 
329  /* Create the property sheet */
330  hPropSheet = (HWND)PropertySheetW(&psh);
331  if (hPropSheet)
332  {
333  /* Center the property sheet on the desktop and show it */
335  ShowWindow(hPropSheet, SW_SHOWNORMAL);
336  }
337 
338  return hPropSheet;
339 }
HWND hwndParent
Definition: prsht.h:277
BOOL BackupIniFile(IN LPCWSTR lpszIniFile)
Definition: fileutils.c:93
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:290
LPCWSTR pszTemplate
Definition: prsht.h:209
#define IDS_TAB_BOOT
Definition: resource.h:50
HANDLE HWND
Definition: compat.h:13
BOOL bIsWindows
Definition: msconfig.c:31
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LPCWSTR lpszFreeLdrIni
Definition: freeldrpage.c:21
LPCWSTR lpszBootIni
Definition: freeldrpage.c:22
INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: srvpage.c:22
#define IDS_TAB_WIN
Definition: resource.h:35
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define PSH_MODELESS
Definition: prsht.h:50
#define PSH_USECALLBACK
Definition: prsht.h:48
int CALLBACK PropSheetCallback(HWND hDlg, UINT message, LPARAM lParam)
Definition: msconfig.c:139
#define IDD_TOOLS_PAGE
Definition: resource.h:4
INT_PTR CALLBACK SystemPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: system.c:383
BOOL bIsPreVistaOSVersion
Definition: msconfig.c:32
HINSTANCE hInstance
Definition: charmap.c:20
#define IDD_SYSTEM_PAGE
Definition: resource.h:9
VOID ClipOrCenterWindowToMonitor(HWND hWnd, UINT flags)
Definition: utils.c:216
DWORD dwSize
Definition: prsht.h:205
LPCWSTR pszCaption
Definition: prsht.h:283
DLGPROC pfnDlgProc
Definition: prsht.h:217
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:293
struct _PROPSHEETPAGEW PROPSHEETPAGEW
smooth NULL
Definition: ftsmooth.c:416
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2896
LPCWSTR pszTitle
Definition: prsht.h:216
#define MONITOR_CENTER
Definition: utils.h:67
INT_PTR CALLBACK FreeLdrPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: freeldrpage.c:134
HINSTANCE hInstance
Definition: prsht.h:278
#define PSH_HASHELP
Definition: prsht.h:49
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwSize
Definition: prsht.h:275
DWORD dwFlags
Definition: prsht.h:276
#define MONITOR_WORKAREA
Definition: utils.h:69
#define IDS_TAB_SYSTEM
Definition: resource.h:73
BOOL MyFileExists(IN LPCWSTR lpszFilePath, OUT PWIN32_FIND_DATAW pFindData OPTIONAL)
Definition: fileutils.c:18
INT_PTR CALLBACK WinPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: systempage.cpp:882
LPARAM lParam
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:207
#define IDS_TAB_FREELDR
Definition: resource.h:74
#define PSP_USETITLE
Definition: prsht.h:26
#define IDD_GENERAL_PAGE
Definition: resource.h:6
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define IDD_SERVICES_PAGE
Definition: resource.h:5
LPCWSTR lpszWinIni
Definition: systempage.cpp:24
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
INT_PTR CALLBACK ToolsPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: toolspage.c:56
LPCWSTR lpszSystemIni
Definition: systempage.cpp:23
INT_PTR CALLBACK StartupPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: startuppage.c:20
#define PSP_HASHELP
Definition: prsht.h:28
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDD_FREELDR_PAGE
Definition: resource.h:8
#define IDD_STARTUP_PAGE
Definition: resource.h:7
INT_PTR CALLBACK GeneralPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: generalpage.c:25
DWORD dwFlags
Definition: prsht.h:206
#define LPARAM
Definition: msvc.h:38
UINT nStartPage
Definition: prsht.h:286

◆ Initialize()

BOOL Initialize ( HINSTANCE  hInstance)

Definition at line 341 of file msconfig.c.

Referenced by _tWinMain(), CSysPagerWnd::ContextSensitiveHelp(), CStartButton::Create(), DECLARE_INTERFACE_(), DECLARE_INTERFACE_IID_(), and CZipFolder::Initialize().

342 {
343  BOOL Success = TRUE;
344  LPWSTR lpszVistaAppName = NULL;
345  HANDLE hSemaphore;
347 
348  /* Initialize our global version flags */
351 
352  /* Initialize global strings */
355  lpszVistaAppName = LoadResourceString(hInstance, IDS_MSCONFIG_2);
356 
357  /* We use a semaphore in order to have a single-instance application */
358  hSemaphore = CreateSemaphoreW(NULL, 0, 1, L"MSConfigRunning");
359  if (!hSemaphore || GetLastError() == ERROR_ALREADY_EXISTS)
360  {
361  CloseHandle(hSemaphore);
362 
363  /*
364  * A semaphore with the same name already exist. It should have been
365  * created by another instance of MSConfig. Try to find its window
366  * and bring it to front.
367  */
368  if ( (hSingleWnd && IsWindow(hSingleWnd)) ||
369  ( (hSingleWnd = FindWindowW(L"#32770", szAppName)) != NULL ) ||
370  (!bIsPreVistaOSVersion ? ( (hSingleWnd = FindWindowW(L"#32770", lpszVistaAppName)) != NULL ) : FALSE) )
371  {
372  /* Found it. Show the window. */
373  ShowWindow(hSingleWnd, SW_SHOWNORMAL);
374  SetForegroundWindow(hSingleWnd);
375  }
376 
377  /* Quit this instance of MSConfig */
378  Success = FALSE;
379  }
380  if (!bIsPreVistaOSVersion) MemFree(lpszVistaAppName);
381 
382  /* Quit now if we failed */
383  if (!Success)
384  {
386  return FALSE;
387  }
388 
389  /* Initialize the common controls */
390  InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
391  InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS /* | ICC_PROGRESS_CLASS | ICC_HOTKEY_CLASS*/;
392  InitCommonControlsEx(&InitControls);
393 
394  hInst = hInstance;
395 
396  return Success;
397 }
BOOL IsPreVistaOSVersion(VOID)
Definition: utils.c:275
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
BOOL MemFree(IN PVOID lpMem)
Definition: utils.c:26
BOOL WINAPI IsWindow(_In_opt_ HWND)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:444
HINSTANCE hInst
Definition: msconfig.c:19
BOOL bIsWindows
Definition: msconfig.c:31
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
BOOL IsWindowsOS(VOID)
Definition: utils.c:226
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:297
BOOL bIsPreVistaOSVersion
Definition: msconfig.c:32
HINSTANCE hInstance
Definition: charmap.c:20
#define ICC_TREEVIEW_CLASSES
Definition: commctrl.h:59
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62
smooth NULL
Definition: ftsmooth.c:416
LPWSTR szAppName
Definition: msconfig.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID LoadResourceString(UINT ResourceId, LPVOID Buffer, UINT ccount, LPVOID DefaultString, BOOL bUnicode)
Definition: enum.c:13
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
#define IDS_MSCONFIG
Definition: resource.h:114
static const WCHAR L[]
Definition: oid.c:1087
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDS_MSCONFIG_2
Definition: resource.h:148

◆ MainWndProc()

LRESULT CALLBACK MainWndProc ( HWND  hWnd,
UINT  uMessage,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 70 of file msconfig.c.

Referenced by PropSheetCallback().

71 {
72  switch (uMessage)
73  {
74  case WM_SYSCOMMAND:
75  {
76  switch (LOWORD(wParam) /*GET_WM_COMMAND_ID(wParam, lParam)*/)
77  {
78  case IDM_ABOUT:
80  // break;
81  return TRUE;
82  }
83 
84  // break;
85  return FALSE;
86  }
87 
88  case WM_COMMAND:
89  {
90  switch (LOWORD(wParam) /*GET_WM_COMMAND_ID(wParam, lParam)*/)
91  {
92  case IDM_ABOUT:
94  // break;
95  return TRUE;
96  }
97 
98  break;
99  // return FALSE;
100  }
101 
102  case WM_DESTROY:
103  {
104  if (wpOrigEditProc)
106 
107  if (hIcon) DestroyIcon(hIcon);
109  }
110 
111  default:
112  break;
113  }
114 
115  /* Return */
116  if (wpOrigEditProc)
117  return CallWindowProc(wpOrigEditProc, hWnd, uMessage, wParam, lParam);
118  else
119  return FALSE;
120 }
#define CallWindowProc
Definition: winuser.h:5601
#define TRUE
Definition: types.h:120
#define DWLP_DLGPROC
Definition: winuser.h:865
#define IDM_ABOUT
Definition: resource.h:29
WNDPROC wpOrigEditProc
Definition: msconfig.c:45
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
HINSTANCE hInst
Definition: msconfig.c:19
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define IDD_ABOUTBOX
Definition: resource.h:8
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msconfig.c:49
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
#define WM_DESTROY
Definition: winuser.h:1591
#define WM_COMMAND
Definition: winuser.h:1716
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HICON hIconSm
Definition: msconfig.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WM_SYSCOMMAND
Definition: winuser.h:1717
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ PropSheetCallback()

int CALLBACK PropSheetCallback ( HWND  hDlg,
UINT  message,
LPARAM  lParam 
)

Definition at line 139 of file msconfig.c.

Referenced by CreatePropSheet().

140 {
141  switch (message)
142  {
143  case PSCB_PRECREATE:
144  {
145  LPDLGTEMPLATE dlgTemplate = (LPDLGTEMPLATE)lParam;
146  LPDLGTEMPLATEEX dlgTemplateEx = (LPDLGTEMPLATEEX)lParam;
147 
148  // MFC : DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | DS_SETFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION;
150  // DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME;
152 
153  /* Hide the dialog by default; we will center it on screen later, and then show it */
154  style &= ~WS_VISIBLE;
155 
156  /* Set the styles of the property sheet dialog */
157  if (dlgTemplateEx->signature == 0xFFFF)
158  {
159  dlgTemplateEx->style = style;
160  dlgTemplateEx->exStyle = exStyle;
161  }
162  else
163  {
164  dlgTemplate->style = style;
165  dlgTemplate->dwExtendedStyle = exStyle;
166  }
167 
168  break;
169  }
170 
171  case PSCB_INITIALIZED:
172  {
173  /* Customize the window's system menu, add items before the "Close" item */
174  LPWSTR szMenuString;
175  HMENU hSysMenu = GetSystemMenu(hDlg, FALSE);
176  assert(hSysMenu);
177 
178  szMenuString = LoadResourceString(hInst, IDS_ABOUT);
179  if (szMenuString)
180  {
181  /* "About" menu */
182  InsertMenuW(hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_ENABLED | MF_STRING, IDM_ABOUT, szMenuString);
183  /* Separator */
184  InsertMenuW(hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_SEPARATOR , 0 , NULL);
185 
186  MemFree(szMenuString);
187  }
188  DrawMenuBar(hDlg);
189 
190  /* Set the dialog icons */
193  SendMessageW(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
194  SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
195 
196  /* Sub-class the property sheet window procedure */
198 
199  break;
200  }
201 
202  default:
203  break;
204  }
205 
206  return FALSE;
207 }
Definition: tftpd.h:59
static HICON
Definition: imagelist.c:84
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI DrawMenuBar(_In_ HWND)
#define DWLP_DLGPROC
Definition: winuser.h:865
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL MemFree(IN PVOID lpMem)
Definition: utils.c:26
#define IDM_ABOUT
Definition: resource.h:29
BOOL WINAPI InsertMenuW(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
WNDPROC wpOrigEditProc
Definition: msconfig.c:45
HINSTANCE hInst
Definition: msconfig.c:19
DWORD exStyle
Definition: msconfig.c:129
#define MF_STRING
Definition: winuser.h:138
#define DS_CENTER
Definition: winuser.h:369
DWORD style
Definition: winuser.h:3012
#define assert(x)
Definition: debug.h:53
#define SM_CYSMICON
Definition: winuser.h:1003
#define SetWindowLongPtr
Definition: treelist.c:70
#define ICON_SMALL
Definition: tnclass.cpp:48
#define IDS_ABOUT
Definition: resource.h:29
#define DS_MODALFRAME
Definition: winuser.h:375
DWORD style
Definition: msconfig.c:130
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
LONG_PTR LPARAM
Definition: windef.h:208
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define PSCB_PRECREATE
Definition: prsht.h:76
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
#define MF_SEPARATOR
Definition: winuser.h:137
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
Definition: msconfig.c:70
struct DLGTEMPLATE * LPDLGTEMPLATE
DWORD dwExtendedStyle
Definition: winuser.h:3013
#define WS_CAPTION
Definition: pedump.c:624
#define DS_SHELLFONT
Definition: winuser.h:381
VOID LoadResourceString(UINT ResourceId, LPVOID Buffer, UINT ccount, LPVOID DefaultString, BOOL bUnicode)
Definition: enum.c:13
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define MF_ENABLED
Definition: winuser.h:128
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SM_CXSMICON
Definition: winuser.h:1002
#define IDI_APPICON
Definition: resource.h:166
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1089
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define WS_MINIMIZEBOX
Definition: pedump.c:631
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WORD signature
Definition: msconfig.c:127
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_POPUP
Definition: pedump.c:616
#define SC_CLOSE
Definition: winuser.h:2546
HICON hIconSm
Definition: msconfig.c:44
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WS_EX_APPWINDOW
Definition: winuser.h:383
WCHAR * LPWSTR
Definition: xmlstorage.h:184
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
#define ICON_BIG
Definition: tnclass.cpp:51
struct DLGTEMPLATEEX * LPDLGTEMPLATEEX

Variable Documentation

◆ bIsPreVistaOSVersion

BOOL bIsPreVistaOSVersion = TRUE

Definition at line 32 of file msconfig.c.

Referenced by AddService(), and ServicesPageWndProc().

◆ bIsWindows

BOOL bIsWindows = FALSE

◆ hIcon

HICON hIcon = NULL

Definition at line 44 of file msconfig.c.

Referenced by AboutDialogProc(), COpenWithMenu::AddApp(), COpenWithDialog::AddApp(), CSideTreeView::AddCategory(), AddOrUpdateHwnd(), ClickLockProc(), CreateDialogProc(), CreateHelpDialogProc(), CreateIcon(), CreateIconFromResourceEx(), CreateLayoutIcon(), CShellLink::CreateShortcutIcon(), CreateTrayIcon(), DEFINE_ENUM_FLAG_OPERATORS(), DefWndSetIcon(), DeleteDialogProc(), DestroyIconList(), DoExtractIcon(), EnumerateCallback(), EnumPickIconResourceProc(), EnumWindowsProc(), TaskBar::EnumWndProc(), IconCache::extract(), ExtractAssociatedIconA(), ExtractAssociatedIconW(), ExtractIconW(), FD31_WMDrawItem(), CFileDefExt::GeneralPageProc(), get_window_icon_big(), get_window_icon_small(), GetGeneralGroupData(), GetStartMenuBtnTextWidth(), GetUserMembershipData(), CTaskSwitchWnd::GetWndIcon(), Ghost_GetIcon(), GRPFILE_ReadGroupFile(), CNewMenu::HandleMenuMsg2(), IconCache::IconCache(), ImageList_GetIcon(), ImageListImpl_GetIcon(), InitDialog(), initDialog(), CDrvDefExt::InitGeneralPage(), InitGroupMembersList(), CDesktopFolderEnum::Initialize(), InitializeDxDiagDialog(), InitImageList(), CFileDefExt::InitOpensWithField(), InitUserGroupsList(), LoadShellLinkConsoleInfo(), MainWndProc(), MDI_AugmentFrameMenu(), NC_IconForWindow(), CSysTray::NotifyIcon(), OnCommand(), OnCommandAbout(), OnGroupsPageInitDialog(), CZipExtract::CConfirmReplace::OnInitDialog(), OnInitDialog(), OnPaint(), OSK_DlgInitDialog(), OSK_SetImage(), PickIconProc(), PrivateExtractIconExW(), PROGRAM_AddProgram(), PROGRAM_NewProgram(), propsheet_callback(), PROPSHEET_CollectPageInfo(), PROPSHEET_DialogProc(), PropSheetProc(), RunFileDlg(), CMainWindow::s_EnumAvailableAppProc(), SetConsoleIcon(), SetupDiGetClassImageListExW(), SetupDiLoadClassIcon(), SetWindowIcon(), ShellAboutW(), SoftModalMessageBox(), START_TEST(), StartMenuCtrl::StartMenuCtrl(), STATIC_PaintIconfn(), STATIC_WindowProc(), StaticWndProc_common(), STATUSBAR_SetIcon(), TaskManager_OnFileNew(), test_CreateIcon(), test_fromhicon(), test_marshal_HICON(), Test_OneParamRoutine_CreateEmptyCurObject(), test_pack_NOTIFYICONDATAA(), test_pack_NOTIFYICONDATAW(), test_pack_SHFILEINFOA(), test_pack_SHFILEINFOW(), test_pack_WNDCLASSA(), test_pack_WNDCLASSEXA(), test_pack_WNDCLASSEXW(), test_pack_WNDCLASSW(), test_status_control(), ThemeDrawCaption(), TOOLTIPS_GetTitleIconIndex(), TrayIcon_ShellAddTrayIcon(), TrayIcon_ShellUpdateTrayIcon(), CMainWindow::UpdateApplicationsList(), UpdateLanStatus(), User32DefWindowProc(), UserGetWindowIcon(), WINHELP_CreateHelpWindow(), WndProc(), and COpenWithList::~COpenWithList().

◆ hIconSm

◆ hInst

HINSTANCE hInst = NULL

Definition at line 39 of file msconfig.c.

◆ hMainWnd

HWND hMainWnd

Definition at line 41 of file msconfig.c.

◆ hTabWnd

HWND hTabWnd

Definition at line 43 of file msconfig.c.

◆ IDS_MICROSOFT

const LPCWSTR IDS_MICROSOFT = L"Microsoft"

Definition at line 36 of file msconfig.c.

Referenced by AddService(), and ServicesPageWndProc().

◆ IDS_REACTOS

const LPCWSTR IDS_REACTOS = L"ReactOS"

Definition at line 35 of file msconfig.c.

◆ IDS_WINDOWS

const LPCWSTR IDS_WINDOWS = L"Windows"

Definition at line 37 of file msconfig.c.

Referenced by RequiredServicesDisablingDialogWndProc().

◆ szAppName

LPWSTR szAppName = NULL

Definition at line 40 of file msconfig.c.

◆ wpOrigEditProc

WNDPROC wpOrigEditProc = NULL

Definition at line 45 of file msconfig.c.