Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

652 lines
17 KiB

  1. //Copyright (c) 1997-2000 Microsoft Corporation
  2. #include "pch.hxx" // PCH
  3. #pragma hdrstop
  4. #include "AccWiz.h"
  5. #include "resource.h"
  6. #include "pgfinish.h"
  7. #include "pgGenric.h"
  8. // Welcome page
  9. #include "pgnWelCome.h"
  10. #include "pgWelcom.h"
  11. #include "pgWelco2.h"
  12. // Options page
  13. #include "pgWizOpt.h"
  14. // Color pages
  15. #include "pgLokPrv.h"
  16. // Mouse pages
  17. #include "pgMseCur.h"
  18. #include "pgMseBut.h"
  19. #include "pgcaret.h"
  20. #include "pgTmeOut.h"
  21. #include "pgSveDef.h"
  22. #include "pgSveFil.h"
  23. #include "pgExtras.h"
  24. #include "LookPrev.h"
  25. #include "Select.h"
  26. #include "w95trace.h"
  27. EXTERN_C BOOL WINAPI LinkWindow_RegisterClass() ;
  28. // Declaration of the global options variable
  29. CAccWizOptions g_Options;
  30. HINSTANCE g_hInstDll = NULL; // DLL instance handle.
  31. BOOL g_bHACKHACKSavedOptions = FALSE;
  32. HANDLE g_hAccwizRunning;
  33. int WINAPI WinMain(
  34. HINSTANCE hInstance, // handle to current instance
  35. HINSTANCE hPrevInstance, // handle to previous instance
  36. LPSTR lpCmdLine, // pointer to command line
  37. int nCmdShow // show state of window
  38. )
  39. {
  40. g_hInstDll = hInstance;
  41. SetLastError(0);
  42. // Allow only ONE instance of the program to run.
  43. // The mutex is automatically destroyed when Accwiz exits
  44. g_hAccwizRunning = CreateMutex(NULL, TRUE, TEXT("AK:AccwizRunning:KHALI"));
  45. if ( (g_hAccwizRunning == NULL) ||
  46. (GetLastError() == ERROR_ALREADY_EXISTS) )
  47. {
  48. return 0;
  49. }
  50. // Required for Link Window OLE marshalling :AK
  51. DBPRINTF(TEXT("Calling CoInitialize\r\n"));
  52. if (FAILED(CoInitialize(NULL)))
  53. return 0; // Prefix #113783 (quit if CoInitialize fails)
  54. g_Options.InitAccWizOptions();
  55. InitCommonControls();
  56. // for the Link Window in finish page...
  57. LinkWindow_RegisterClass();
  58. VERIFY(CLookPrev::sm_Globals.Initialize()); // Make sure this has been initialized
  59. // VERIFY(CSelection::Initialize()); // Make sure this has been initialized: chnage this!
  60. // Get the commandline so that it works for MUI/Unicode
  61. LPTSTR lpCmdLineW = GetCommandLine();
  62. if ( *lpCmdLineW == TEXT('\"') ) {
  63. /*
  64. * Scan, and skip over, subsequent characters until
  65. * another double-quote or a null is encountered.
  66. */
  67. while ( *++lpCmdLineW && (*lpCmdLineW
  68. != TEXT('\"')) );
  69. /*
  70. * If we stopped on a double-quote (usual case), skip
  71. * over it.
  72. */
  73. if ( *lpCmdLineW == TEXT('\"') )
  74. lpCmdLineW++;
  75. }
  76. else {
  77. while (*lpCmdLineW > TEXT(' '))
  78. lpCmdLineW++;
  79. }
  80. /*
  81. * Skip past any white space preceeding the second token.
  82. */
  83. while (*lpCmdLineW && (*lpCmdLineW <= TEXT(' '))) {
  84. lpCmdLineW++;
  85. }
  86. if(NULL != lpCmdLineW && lstrlen(lpCmdLineW))
  87. {
  88. TCHAR szFileName[_MAX_PATH];
  89. lstrcpy(szFileName, lpCmdLineW);
  90. StrTrim(szFileName, TEXT("\"\0"));
  91. // Load the settings file back in.
  92. HANDLE hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  93. if(hFile != INVALID_HANDLE_VALUE)
  94. {
  95. // declare structs for each scheme we might encounter
  96. WIZSCHEME_LEGACY_STRUCT(WIZSCHEME_WIN9X, schemeLegacyWin9x, COLOR_MAX_WIN9X) /* Win9x & Millen */
  97. WIZSCHEME_LEGACY_STRUCT(WIZSCHEME_NT400, schemeLegacyNT400, COLOR_MAX_NT400) /* WinNT 4.0 */
  98. WIZSCHEME_LEGACY_STRUCT(WIZSCHEME_NT500, schemeLegacyNT500, COLOR_MAX_NT500) /* Win2K */
  99. WIZSCHEME_LEGACY_STRUCT(WIZSCHEME_NT401, schemeLegacyNT501, COLOR_MAX_NT501) /* WinXP */
  100. // see if we can find the right scheme in order of ascending size
  101. #define OLD2NEW_SCHEME(scheme) \
  102. { \
  103. DWORD dwRead; \
  104. ReadFile(hFile, (LPVOID)&scheme, sizeof(scheme), &dwRead, NULL); \
  105. if (dwRead != scheme.m_cbSize) \
  106. { \
  107. StringTableMessageBox(NULL, IDS_WIZERRORLOADINGFILETEXT, IDS_WIZERRORLOADINGFILETITLE, MB_OK); \
  108. return 0; \
  109. } \
  110. WIZSCHEME_COPY_LEGACY(g_Options.m_schemePreview, scheme) \
  111. /* legacy schemes wouldn't have theme or wallpaper set */ \
  112. g_Options.m_schemePreview.ClearTheme(); \
  113. g_Options.m_schemePreview.ClearWallpaper(); \
  114. /* figure out what the legacy scheme's SelectedStyle and SelectedSize is */ \
  115. g_Options.m_schemePreview.SetStyleNSize(); \
  116. }
  117. DWORD dwFileSize = GetFileSize(hFile, NULL);
  118. if (dwFileSize == schemeLegacyWin9x.m_cbSize)
  119. {
  120. OLD2NEW_SCHEME(schemeLegacyWin9x)
  121. }
  122. else if (dwFileSize == schemeLegacyNT400.m_cbSize)
  123. {
  124. OLD2NEW_SCHEME(schemeLegacyNT400)
  125. }
  126. else if (dwFileSize == schemeLegacyNT500.m_cbSize)
  127. {
  128. OLD2NEW_SCHEME(schemeLegacyNT500)
  129. }
  130. else if (dwFileSize == schemeLegacyNT501.m_cbSize)
  131. {
  132. OLD2NEW_SCHEME(schemeLegacyNT501)
  133. }
  134. else
  135. {
  136. StringTableMessageBox(NULL, IDS_WIZERRORLOADINGFILETEXT, IDS_WIZERRORLOADINGFILETITLE, MB_OK);
  137. return 0;
  138. }
  139. // IMPORTANT: For loaded schemes, we always want to change to the windows default font
  140. g_Options.m_schemePreview.m_PortableNonClientMetrics.m_nFontFaces = 1;
  141. g_bHACKHACKSavedOptions = TRUE;
  142. g_Options.ApplyPreview();
  143. }
  144. else
  145. {
  146. StringTableMessageBox(NULL, IDS_WIZERRORLOADINGFILETEXT, IDS_WIZERRORLOADINGFILETITLE, MB_OK);
  147. return 0;
  148. }
  149. }
  150. #ifdef UNICODE
  151. AccWiz_RunDllW(NULL, hInstance, lpCmdLineW, nCmdShow);
  152. #else
  153. AccWiz_RunDllA(NULL, hInstance, lpCmdLineW, nCmdShow);
  154. #endif
  155. return 0;
  156. }
  157. HRESULT
  158. CreateAndRunWizard(
  159. HWND hwndParent);
  160. HRESULT
  161. CreateAndRunWizard2(
  162. HWND hwndParent);
  163. HRESULT
  164. OnProcessAttach(
  165. HINSTANCE hInstDll);
  166. HRESULT
  167. OnProcessDetach(
  168. VOID);
  169. INT
  170. PropSheetCallback(
  171. HWND hwnd,
  172. UINT uMsg,
  173. LPARAM lParam);
  174. VOID WINAPI AccWiz_RunDllA(HWND hwnd, HINSTANCE hInstance, LPSTR pszCmdLineA, INT nCmdShow)
  175. {
  176. if (NULL != pszCmdLineA)
  177. {
  178. LPWSTR pszCmdLineW = NULL;
  179. INT cchCmdLine = MultiByteToWideChar(CP_ACP,
  180. 0,
  181. pszCmdLineA,
  182. -1,
  183. NULL,
  184. 0);
  185. pszCmdLineW = new WCHAR[cchCmdLine];
  186. if (NULL != pszCmdLineW)
  187. {
  188. MultiByteToWideChar(CP_ACP,
  189. 0,
  190. pszCmdLineA,
  191. -1,
  192. pszCmdLineW,
  193. cchCmdLine);
  194. AccWiz_RunDllW(hwnd, hInstance, pszCmdLineW, nCmdShow);
  195. delete[] pszCmdLineW;
  196. }
  197. }
  198. }
  199. VOID WINAPI AccWiz_RunDllW(HWND hwnd, HINSTANCE hInstance, LPWSTR pszCmdLineW, INT nCmdShow)
  200. {
  201. HWND hwndParent = GetDesktopWindow();
  202. HRESULT hResult;
  203. if(!g_bHACKHACKSavedOptions)
  204. hResult = CreateAndRunWizard(hwndParent);
  205. else
  206. hResult = CreateAndRunWizard2(hwndParent);
  207. if(!SUCCEEDED(hResult))
  208. {
  209. // TODO: Put out of memory message here
  210. _ASSERTE(FALSE);
  211. #pragma message("Put Out of Memory message here")
  212. }
  213. }
  214. const INT MAX_PAGES = 26;
  215. HRESULT
  216. CreateAndRunWizard(
  217. HWND hwndParent)
  218. {
  219. HRESULT hResult = E_OUTOFMEMORY;
  220. PROPSHEETPAGE psp[MAX_PAGES];
  221. WizardPage *rgpwp[MAX_PAGES];
  222. // Zero init the arrays
  223. memset(&psp, 0, sizeof(psp));
  224. memset(&rgpwp, 0, sizeof(rgpwp));
  225. // ///////////////////////
  226. // Create Pages Here - NOTE: Order does not matter - we'll control it with our own list
  227. //
  228. int nCountPages = 0;
  229. rgpwp[nCountPages++] = new CWizWelcomePg(psp + nCountPages);
  230. rgpwp[nCountPages++] = new CWelcomePg(psp + nCountPages);
  231. rgpwp[nCountPages++] = new CWelcome2Pg(psp + nCountPages);
  232. rgpwp[nCountPages++] = new CWizardOptionsPg(psp + nCountPages);
  233. rgpwp[nCountPages++] = new CScrollBarPg(psp + nCountPages);
  234. rgpwp[nCountPages++] = new CIconSizePg(psp + nCountPages);
  235. // Color
  236. rgpwp[nCountPages++] = new CLookPreviewColorPg(psp + nCountPages);
  237. // Sound
  238. rgpwp[nCountPages++] = new CSoundSentryPg(psp + nCountPages);
  239. rgpwp[nCountPages++] = new CShowSoundsPg(psp + nCountPages);
  240. // Keyboard
  241. rgpwp[nCountPages++] = new CStickyKeysPg(psp + nCountPages);
  242. rgpwp[nCountPages++] = new CFilterKeysPg(psp + nCountPages);
  243. rgpwp[nCountPages++] = new CFilterKeysSettingsPg(psp + nCountPages);
  244. rgpwp[nCountPages++] = new CToggleKeysPg(psp + nCountPages);
  245. rgpwp[nCountPages++] = new CShowKeyboardHelpPg(psp + nCountPages);
  246. // Mouse
  247. rgpwp[nCountPages++] = new CMouseKeysPg(psp + nCountPages);
  248. rgpwp[nCountPages++] = new CMouseKeysSettingsPg(psp + nCountPages);
  249. rgpwp[nCountPages++] = new CMouseTrailsPg(psp + nCountPages);
  250. rgpwp[nCountPages++] = new CMouseCursorPg(psp + nCountPages);
  251. rgpwp[nCountPages++] = new CMouseButtonPg(psp + nCountPages);
  252. rgpwp[nCountPages++] = new CMouseSpeedPg(psp + nCountPages);
  253. rgpwp[nCountPages++] = new CCaretPg(psp + nCountPages);
  254. // Standard Wizard pages
  255. rgpwp[nCountPages++] = new CGenericWizPg(psp + nCountPages, IDD_WIZNOOPTIONSSELECTED, IDS_WIZNOOPTIONSSELECTEDTITLE, IDS_WIZNOOPTIONSSELECTEDSUBTITLE);
  256. rgpwp[nCountPages++] = new CAccessTimeOutPg(psp + nCountPages);
  257. rgpwp[nCountPages++] = new CSaveForDefaultUserPg(psp + nCountPages);
  258. rgpwp[nCountPages++] = new CSaveToFilePg(psp + nCountPages);
  259. rgpwp[nCountPages++] = new FinishWizPg(psp + nCountPages);
  260. // Make sure we have the correct number of pages in our wizard
  261. _ASSERTE(MAX_PAGES == nCountPages);
  262. // Make sure pages were created
  263. for (int i = 0; i < nCountPages; i++)
  264. {
  265. if (NULL == rgpwp[i])
  266. break;
  267. }
  268. if(i<nCountPages)
  269. {
  270. // We didn't have enough memory to create all the pages
  271. // Clean out allocated pages and return
  272. for(int i=0;i<nCountPages;i++)
  273. if(rgpwp[i])
  274. delete rgpwp[i];
  275. return E_OUTOFMEMORY;
  276. }
  277. // Create the orders for the pages to be run
  278. DWORD rgdwMainPath[] = {
  279. IDD_WIZNEWWELCOME,
  280. IDD_WIZWELCOME,
  281. IDD_WIZWELCOME2,
  282. IDD_WIZOPTIONS,
  283. IDD_WIZFINISH // We need this placeholder here so we get a 'NEXT' button on IDD_WIZOPTIONS
  284. };
  285. if(!WizardPage::sm_WizPageOrder.AddPages(0xFFFFFFFF, rgdwMainPath, ARRAYSIZE(rgdwMainPath)))
  286. return E_OUTOFMEMORY;
  287. /////////////////////////////////////////////
  288. // See if we need the 16 or 256 color bitmap
  289. BOOL bUse256ColorBmp = FALSE;
  290. HDC hdc = GetDC(NULL);
  291. if(hdc)
  292. {
  293. if(GetDeviceCaps(hdc,BITSPIXEL) >= 8)
  294. bUse256ColorBmp = TRUE;
  295. ReleaseDC(NULL, hdc);
  296. }
  297. ////////////////////////////////
  298. // Do the property sheet
  299. PROPSHEETHEADER psh;
  300. memset(&psh, 0, sizeof(psh));
  301. psh.dwSize = sizeof(PROPSHEETHEADER);
  302. psh.dwFlags = PSH_USECALLBACK | PSH_WIZARD | PSH_PROPSHEETPAGE
  303. | PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER /*| *//*PSH_STRETCHWATERMARK*/;
  304. psh.hwndParent = hwndParent;
  305. psh.hInstance = g_hInstDll;
  306. psh.pszIcon = NULL;
  307. psh.pszCaption = NULL;
  308. psh.nPages = MAX_PAGES;
  309. psh.nStartPage = 54331; // We will actually set it in PropSheetCallback to rgdwMainPath[0]
  310. // NOTE: Bug - This only works if nStartPage is non-zero
  311. psh.ppsp = psp;
  312. psh.pfnCallback = PropSheetCallback;
  313. #if 0
  314. psh.nStartPage = 0; // We will actually set it in PropSheetCallback to rgdwMainPath[0]
  315. psh.pfnCallback = NULL;
  316. psh.dwFlags = PSH_WIZARD | PSH_PROPSHEETPAGE;
  317. #endif
  318. psh.pszbmWatermark = MAKEINTRESOURCE(IDB_ACCWIZ);
  319. psh.pszbmHeader = MAKEINTRESOURCE(IDB_ACCMARK);
  320. #if 0 // Right now, no watermarks
  321. psh.pszbmWatermark = bUse256ColorBmp?MAKEINTRESOURCE(IDB_WATERMARK256):MAKEINTRESOURCE(IDB_WATERMARK16);
  322. psh.pszbmHeader = bUse256ColorBmp?MAKEINTRESOURCE(IDB_BANNER256):MAKEINTRESOURCE(IDB_BANNER16);
  323. #endif
  324. if (-1 != PropertySheet(&psh))
  325. hResult = NO_ERROR;
  326. else
  327. hResult = E_FAIL;
  328. // Clean up memory allocated for WizardPage's
  329. for(i=0;i<nCountPages;i++)
  330. if(rgpwp[i])
  331. delete rgpwp[i];
  332. return hResult;
  333. }
  334. HRESULT
  335. CreateAndRunWizard2(
  336. HWND hwndParent)
  337. {
  338. HRESULT hResult = E_OUTOFMEMORY;
  339. PROPSHEETPAGE psp[1];
  340. WizardPage *rgpwp[1];
  341. // Zero init the arrays
  342. memset(&psp, 0, sizeof(psp));
  343. memset(&rgpwp, 0, sizeof(rgpwp));
  344. // ///////////////////////
  345. // Create Pages Here - NOTE: Order does not matter - we'll control it with our own list
  346. //
  347. int nCountPages = 0;
  348. rgpwp[nCountPages++] = new FinishWizPg(psp + nCountPages);
  349. // Make sure pages were created
  350. for (int i = 0; i < nCountPages; i++)
  351. {
  352. if (NULL == rgpwp[i])
  353. break;
  354. }
  355. if(i<nCountPages)
  356. {
  357. // We didn't have enough memory to create all the pages
  358. // Clean out allocated pages and return
  359. for(int i=0;i<nCountPages;i++)
  360. if(rgpwp[i])
  361. delete rgpwp[i];
  362. return E_OUTOFMEMORY;
  363. }
  364. // Create the orders for the pages to be run
  365. DWORD rgdwMainPath[] = {
  366. IDD_WIZFINISH // We need this placeholder here so we get a 'NEXT' button on IDD_WIZOPTIONS
  367. };
  368. if(!WizardPage::sm_WizPageOrder.AddPages(0xFFFFFFFF, rgdwMainPath, ARRAYSIZE(rgdwMainPath)))
  369. return E_OUTOFMEMORY;
  370. /////////////////////////////////////////////
  371. // See if we need the 16 or 256 color bitmap
  372. BOOL bUse256ColorBmp = FALSE;
  373. HDC hdc = GetDC(NULL);
  374. if(hdc)
  375. {
  376. if(GetDeviceCaps(hdc,BITSPIXEL) >= 8)
  377. bUse256ColorBmp = TRUE;
  378. ReleaseDC(NULL, hdc);
  379. }
  380. ////////////////////////////////
  381. // Do the property sheet
  382. PROPSHEETHEADER psh;
  383. memset(&psh, 0, sizeof(psh));
  384. psh.dwSize = sizeof(PROPSHEETHEADER);
  385. psh.dwFlags = PSH_USECALLBACK | PSH_WIZARD | PSH_PROPSHEETPAGE
  386. | PSH_WIZARD97 | PSH_WATERMARK |PSH_HEADER /*| *//*PSH_STRETCHWATERMARK*/;
  387. psh.hwndParent = hwndParent;
  388. psh.hInstance = g_hInstDll;
  389. psh.pszIcon = NULL;
  390. psh.pszCaption = NULL;
  391. psh.nPages = 1;
  392. psh.nStartPage = 54331; // We will actually set it in PropSheetCallback to rgdwMainPath[0]
  393. // NOTE: Bug - This only works if nStartPage is non-zero
  394. psh.ppsp = psp;
  395. psh.pfnCallback = PropSheetCallback;
  396. #if 0
  397. psh.nStartPage = 0; // We will actually set it in PropSheetCallback to rgdwMainPath[0]
  398. psh.pfnCallback = NULL;
  399. psh.dwFlags = PSH_WIZARD | PSH_PROPSHEETPAGE;
  400. #endif
  401. psh.pszbmWatermark = MAKEINTRESOURCE(IDB_ACCWIZ);
  402. psh.pszbmHeader = MAKEINTRESOURCE(IDB_ACCMARK);
  403. #if 0 // Right now, no watermarks
  404. psh.pszbmWatermark = bUse256ColorBmp?MAKEINTRESOURCE(IDB_WATERMARK256):MAKEINTRESOURCE(IDB_WATERMARK16);
  405. psh.pszbmHeader = bUse256ColorBmp?MAKEINTRESOURCE(IDB_BANNER256):MAKEINTRESOURCE(IDB_BANNER16);
  406. #endif
  407. if (-1 != PropertySheet(&psh))
  408. hResult = NO_ERROR;
  409. else
  410. hResult = E_FAIL;
  411. // Clean up memory allocated for WizardPage's
  412. for(i=0;i<nCountPages;i++)
  413. if(rgpwp[i])
  414. delete rgpwp[i];
  415. return hResult;
  416. }
  417. INT
  418. PropSheetCallback(
  419. HWND hwnd,
  420. UINT uMsg,
  421. LPARAM lParam
  422. )
  423. {
  424. switch(uMsg)
  425. {
  426. case PSCB_PRECREATE:
  427. break;
  428. case PSCB_INITIALIZED:
  429. {
  430. // Set the first page according to are global list of page orders
  431. // PropSheet_SetCurSelByID(hwnd, WizardPage::sm_WizPageOrder.GetFirstPage());
  432. // HACK - Set TO Options page since we added WIZWIZ page
  433. // HACK. Remove Context Sensitive help
  434. LONG Style = GetWindowLong(hwnd, GWL_EXSTYLE);
  435. if(0 == Style)
  436. {
  437. // DbgTrace((DEBUG_ERROR, "GetWindowLong failed. WizDlgs.cpp\n"));
  438. // DbgTraceSystemError(GetLastError());
  439. }
  440. if(0 == SetWindowLong(hwnd, GWL_EXSTYLE, Style & ~WS_EX_CONTEXTHELP))
  441. {
  442. // DbgTrace((DEBUG_ERROR, "SetWindowLong failed. WizDlgs.cpp\n"));
  443. // DbgTraceSystemError(GetLastError());
  444. }
  445. #ifdef WIZWIZ
  446. _ASSERTE(IDD_WIZWIZ == WizardPage::sm_WizPageOrder.GetFirstPage()); // Change this if we remove the wiz wiz page
  447. PropSheet_SetCurSelByID(hwnd, IDD_WIZWELCOME);
  448. #endif
  449. }
  450. break;
  451. }
  452. return 0;
  453. }
  454. // Helper functions
  455. // Helper function
  456. void LoadArrayFromStringTable(int nIdString, int *rgnValues, int *pnCountValues)
  457. {
  458. // This function load the allowed value array from the string table
  459. // If the values are not stored in the string table, the function
  460. // can be overridden in a derived class
  461. // Load in allowed sizes for scroll bar from string table
  462. _ASSERTE(nIdString); // Make sure we were passed a string
  463. TCHAR szArray[255];
  464. LoadString(g_hInstDll, nIdString, szArray, ARRAYSIZE(szArray));
  465. // Assume at most MAX_DISTINCT_VALUES sizes
  466. LPTSTR szCurrentLocation = szArray;
  467. for(int i=0;i<MAX_DISTINCT_VALUES;i++)
  468. {
  469. if(!szCurrentLocation)
  470. break;
  471. int cFlds = _stscanf(szCurrentLocation, __TEXT("%i"), &rgnValues[i]);
  472. _ASSERTE(cFlds);
  473. if (!cFlds)
  474. break; // Prefix #113775 (no more fields)
  475. // Find the next space
  476. // NOTE: If there are more than one spaces between characters, this will read the same entry twice
  477. szCurrentLocation = _tcschr(++szCurrentLocation, __TEXT(' '));
  478. }
  479. *pnCountValues = i;
  480. _ASSERTE(*pnCountValues);
  481. }
  482. // This function is prototyped in the pre-compiled header
  483. int StringTableMessageBox(HWND hWnd, int nText, int nCaption, UINT uType)
  484. {
  485. TCHAR szTitle[1024];
  486. TCHAR szText[1024];
  487. LoadString(g_hInstDll, nCaption, szTitle, ARRAYSIZE(szTitle));
  488. LoadString(g_hInstDll, nText, szText, ARRAYSIZE(szText));
  489. return MessageBox(hWnd, szText, szTitle, uType);
  490. }
  491. void CAccWizOptions::ApplyWindowsDefault()
  492. {
  493. HKEY hkey;
  494. DWORD dwDisposition;
  495. DWORD len;
  496. m_schemeCurrent.ApplyChanges(m_schemeWindowsDefault);
  497. // BUG: Update the preview scheme. Else will put back the old
  498. // color scheme if something changes
  499. m_schemePreview = m_schemeWindowsDefault;
  500. }