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.

81 lines
1.3 KiB

  1. // Copyright (C) 1997 Microsoft Corporation
  2. //
  3. // dcpromo2 wizard base class
  4. //
  5. // 1-15-97 sburns
  6. #include "headers.hxx"
  7. #include "page.hpp"
  8. #include "resource.h"
  9. #include "state.hpp"
  10. DCPromoWizardPage::DCPromoWizardPage(
  11. int dialogResID,
  12. int titleResID,
  13. int subtitleResID,
  14. bool isInteriorPage)
  15. :
  16. WizardPage(dialogResID, titleResID, subtitleResID, isInteriorPage)
  17. {
  18. LOG_CTOR(DCPromoWizardPage);
  19. }
  20. DCPromoWizardPage::~DCPromoWizardPage()
  21. {
  22. LOG_DTOR(DCPromoWizardPage);
  23. }
  24. bool
  25. DCPromoWizardPage::OnWizNext()
  26. {
  27. LOG_FUNCTION(DCPromoWizardPage::OnWizNext);
  28. GetWizard().SetNextPageID(hwnd, Validate());
  29. return true;
  30. }
  31. bool
  32. DCPromoWizardPage::OnQueryCancel()
  33. {
  34. LOG_FUNCTION(DCPromoWizardPage::OnQueryCancel);
  35. State& state = State::GetInstance();
  36. int id = IDS_CONFIRM_CANCEL;
  37. switch (state.GetRunContext())
  38. {
  39. case State::BDC_UPGRADE:
  40. case State::PDC_UPGRADE:
  41. {
  42. id = IDS_CONFIRM_UPGRADE_CANCEL;
  43. break;
  44. }
  45. case State::NT5_DC:
  46. case State::NT5_STANDALONE_SERVER:
  47. case State::NT5_MEMBER_SERVER:
  48. default:
  49. {
  50. // do nothing
  51. break;
  52. }
  53. }
  54. Win::SetWindowLongPtr(
  55. hwnd,
  56. DWLP_MSGRESULT,
  57. (popup.MessageBox(hwnd, id, MB_YESNO | MB_DEFBUTTON2) == IDYES)
  58. ? FALSE
  59. : TRUE);
  60. return true;
  61. }