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.

126 lines
2.2 KiB

  1. // Copyright (c) 2001 Microsoft Corporation
  2. //
  3. // File: WelcomePage.cpp
  4. //
  5. // Synopsis: Defines Welcome Page for the CYS
  6. // Wizard
  7. //
  8. // History: 02/03/2001 JeffJon Created
  9. #include "pch.h"
  10. #include "resource.h"
  11. #include "uiutil.h"
  12. #include "InstallationUnitProvider.h"
  13. #include "WelcomePage.h"
  14. static PCWSTR WELCOME_PAGE_HELP = L"cys.chm::/choose_role.htm";
  15. WelcomePage::WelcomePage()
  16. :
  17. CYSWizardPage(
  18. IDD_WELCOME_PAGE,
  19. IDS_WELCOME_TITLE,
  20. IDS_WELCOME_SUBTITLE,
  21. WELCOME_PAGE_HELP,
  22. true,
  23. false)
  24. {
  25. LOG_CTOR(WelcomePage);
  26. }
  27. WelcomePage::~WelcomePage()
  28. {
  29. LOG_DTOR(WelcomePage);
  30. }
  31. void
  32. WelcomePage::OnInit()
  33. {
  34. LOG_FUNCTION(WelcomePage::OnInit);
  35. SetLargeFont(hwnd, IDC_BIG_BOLD_TITLE);
  36. Win::PropSheet_SetTitle(
  37. Win::GetParent(hwnd),
  38. 0,
  39. String::load(IDS_WIZARD_TITLE));
  40. }
  41. bool
  42. WelcomePage::OnSetActive()
  43. {
  44. LOG_FUNCTION(WelcomePage::OnSetActive);
  45. // Only Next and Cancel are available from the Welcome page
  46. Win::PropSheet_SetWizButtons(Win::GetParent(hwnd), PSWIZB_NEXT);
  47. // Set the focus to the Next button so that enter works
  48. Win::PostMessage(
  49. Win::GetParent(hwnd),
  50. WM_NEXTDLGCTL,
  51. (WPARAM) Win::GetDlgItem(Win::GetParent(hwnd), Wizard::NEXT_BTN_ID),
  52. TRUE);
  53. return true;
  54. }
  55. bool
  56. WelcomePage::OnNotify(
  57. HWND /*windowFrom*/,
  58. UINT_PTR controlIDFrom,
  59. UINT code,
  60. LPARAM /*lParam*/)
  61. {
  62. // LOG_FUNCTION(WelcomePage::OnCommand);
  63. bool result = false;
  64. if (controlIDFrom == IDC_FINISH_MESSAGE)
  65. {
  66. switch (code)
  67. {
  68. case NM_CLICK:
  69. case NM_RETURN:
  70. {
  71. ShowHelp(WELCOME_PAGE_HELP);
  72. }
  73. default:
  74. {
  75. // do nothing
  76. break;
  77. }
  78. }
  79. }
  80. return result;
  81. }
  82. int
  83. WelcomePage::Validate()
  84. {
  85. LOG_FUNCTION(WelcomePage::Validate);
  86. // Always show the Before You Begin pag
  87. int nextPage = IDD_BEFORE_BEGIN_PAGE;
  88. LOG(String::format(
  89. L"nextPage = %1!d!",
  90. nextPage));
  91. return nextPage;
  92. }