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.

101 lines
1.4 KiB

  1. // Copyright (C) 1997 Microsoft Corporation
  2. //
  3. // failure page
  4. //
  5. // 12-22-97 sburns
  6. #include "headers.hxx"
  7. #include "page.hpp"
  8. #include "FailurePage.hpp"
  9. #include "resource.h"
  10. #include "state.hpp"
  11. FailurePage::FailurePage()
  12. :
  13. DCPromoWizardPage(
  14. IDD_FAILURE,
  15. IDS_FAILURE_PAGE_TITLE,
  16. IDS_FAILURE_PAGE_SUBTITLE)
  17. {
  18. LOG_CTOR(FailurePage);
  19. }
  20. FailurePage::~FailurePage()
  21. {
  22. LOG_DTOR(FailurePage);
  23. }
  24. void
  25. FailurePage::OnInit()
  26. {
  27. LOG_FUNCTION(FailurePage::OnInit);
  28. }
  29. bool
  30. FailurePage::OnSetActive()
  31. {
  32. LOG_FUNCTION(FailurePage::OnSetActive);
  33. State& state = State::GetInstance();
  34. if (
  35. state.GetOperationResultsCode() == State::SUCCESS
  36. || state.RunHiddenUnattended() )
  37. {
  38. LOG(L"planning to Skip failure page");
  39. Wizard& wiz = GetWizard();
  40. if (wiz.IsBacktracking())
  41. {
  42. // backup once again
  43. wiz.Backtrack(hwnd);
  44. return true;
  45. }
  46. int nextPage = FailurePage::Validate();
  47. if (nextPage != -1)
  48. {
  49. wiz.SetNextPageID(hwnd, nextPage);
  50. return true;
  51. }
  52. state.ClearHiddenWhileUnattended();
  53. }
  54. Win::SetDlgItemText(hwnd, IDC_MESSAGE, state.GetFailureMessage());
  55. Win::PropSheet_SetWizButtons(
  56. Win::GetParent(hwnd),
  57. PSWIZB_BACK | PSWIZB_NEXT);
  58. return true;
  59. }
  60. int
  61. FailurePage::Validate()
  62. {
  63. LOG_FUNCTION(FailurePage::Validate);
  64. return IDD_FINISH;
  65. }