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.

181 lines
3.8 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1996.
  5. //
  6. // File: welcome.cxx
  7. //
  8. // Contents: Task wizard welcome (initial) property page implementation.
  9. //
  10. // Classes: CWelcomePage
  11. //
  12. // History: 11-21-1997 SusiA
  13. //
  14. //---------------------------------------------------------------------------
  15. #include "precomp.h"
  16. CWelcomePage *g_pWelcomePage = NULL;
  17. //+-------------------------------------------------------------------------------
  18. // FUNCTION: SchedWizardWelcomeDlgProc(HWND, UINT, WPARAM, LPARAM)
  19. //
  20. // PURPOSE: Callback dialog procedure for the property page
  21. //
  22. // PARAMETERS:
  23. // hDlg - Dialog box window handle
  24. // uMessage - current message
  25. // wParam - depends on message
  26. // lParam - depends on message
  27. //
  28. // RETURN VALUE:
  29. //
  30. // Depends on message. In general, return TRUE if we process it.
  31. //
  32. // COMMENTS:
  33. //
  34. //+-------------------------------------------------------------------------------
  35. BOOL CALLBACK SchedWizardWelcomeDlgProc(HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam)
  36. {
  37. switch (uMessage)
  38. {
  39. case WM_INITDIALOG:
  40. {
  41. #ifdef _WIZ97FONTS
  42. WND hwndTitle = GetDlgItem(hDlg, IDC_INTROTITLE);
  43. if( hwndTitle)
  44. {
  45. SetWindowFont(hwndTitle, g_pWelcomePage->m_hBoldFont, TRUE);
  46. }
  47. #endif // _WIZ97FONTS
  48. //This handles the 256 color processing init
  49. //for the .bmp
  50. InitPage(hDlg,lParam);
  51. }
  52. break;
  53. case WM_PAINT:
  54. WmPaint(hDlg, uMessage, wParam, lParam);
  55. break;
  56. case WM_PALETTECHANGED:
  57. WmPaletteChanged(hDlg, wParam);
  58. break;
  59. case WM_QUERYNEWPALETTE:
  60. return( WmQueryNewPalette(hDlg) );
  61. break;
  62. case WM_ACTIVATE:
  63. return( WmActivate(hDlg, wParam, lParam) );
  64. break;
  65. case WM_DESTROY:
  66. {
  67. Unload256ColorBitmap();
  68. }
  69. break;
  70. case WM_NOTIFY:
  71. switch (((NMHDR FAR *) lParam)->code)
  72. {
  73. case PSN_KILLACTIVE:
  74. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
  75. return 1;
  76. break;
  77. case PSN_RESET:
  78. // reset to the original values
  79. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
  80. break;
  81. case PSN_SETACTIVE:
  82. PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_NEXT);
  83. break;
  84. case PSN_WIZNEXT:
  85. break;
  86. default:
  87. return FALSE;
  88. }
  89. break;
  90. default:
  91. return FALSE;
  92. }
  93. return TRUE;
  94. }
  95. //+--------------------------------------------------------------------------
  96. //
  97. // Member: CWelcomePage::CWelcomePage
  98. //
  99. // Synopsis: ctor
  100. //
  101. // [phPSP] - filled with prop page handle
  102. //
  103. // History: 11-21-1997 SusiA Stole from Task Scheduler wizard
  104. //
  105. //---------------------------------------------------------------------------
  106. #ifdef _WIZ97FONTS
  107. CWelcomePage::CWelcomePage(
  108. HINSTANCE hinst,
  109. HFONT hBoldFont,
  110. ISyncSchedule *pISyncSched,
  111. HPROPSHEETPAGE *phPSP)
  112. #else
  113. CWelcomePage::CWelcomePage(
  114. HINSTANCE hinst,
  115. ISyncSchedule *pISyncSched,
  116. HPROPSHEETPAGE *phPSP)
  117. #endif // _WIZ97FONTS
  118. {
  119. ZeroMemory(&m_psp, sizeof(PROPSHEETPAGE));
  120. g_pWelcomePage = this;
  121. m_psp.dwSize = sizeof (PROPSHEETPAGE);
  122. m_psp.dwFlags = PSH_DEFAULT;
  123. m_psp.hInstance = hinst;
  124. m_psp.pszTemplate = MAKEINTRESOURCE(IDD_SCHEDWIZ_INTRO);
  125. m_psp.pszIcon = NULL;
  126. m_psp.pfnDlgProc = (DLGPROC) SchedWizardWelcomeDlgProc;
  127. m_psp.lParam = 0;
  128. m_pISyncSched = pISyncSched;
  129. m_pISyncSched->AddRef();
  130. #ifdef _WIZ97FONTS
  131. m_hBoldFont = hBoldFont;
  132. #endif // _WIZ97FONTS
  133. #ifdef WIZARD97
  134. m_psp.dwFlags |= PSP_HIDEHEADER;
  135. #endif // WIZARD97
  136. *phPSP = CreatePropertySheetPage(&m_psp);
  137. }