Leaked source code of windows server 2003
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.

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