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.

124 lines
2.5 KiB

  1. // WelcomePage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CertWiz.h"
  5. #include "WelcomePage.h"
  6. #include "Certificat.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CWelcomePage property page
  14. IMPLEMENT_DYNCREATE(CWelcomePage, CIISWizardBookEnd2)
  15. CWelcomePage::CWelcomePage(CCertificate * pCert)
  16. : CIISWizardBookEnd2(CWelcomePage::IDD, IDS_WELCOME_PAGE_CAPTION, &pCert->m_idErrorText),
  17. m_pCert(pCert),
  18. m_ContinuationFlag(CONTINUE_UNDEFINED)
  19. {
  20. //{{AFX_DATA_INIT(CWelcomePage)
  21. //}}AFX_DATA_INIT
  22. }
  23. CWelcomePage::~CWelcomePage()
  24. {
  25. }
  26. void CWelcomePage::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CIISWizardBookEnd2::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CWelcomePage)
  30. //}}AFX_DATA_MAP
  31. }
  32. BEGIN_MESSAGE_MAP(CWelcomePage, CIISWizardBookEnd2)
  33. //{{AFX_MSG_MAP(CWelcomePage)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CWelcomePage message handlers
  38. LRESULT
  39. CWelcomePage::OnWizardNext()
  40. /*++
  41. Routine Description:
  42. Next button handler
  43. Arguments:
  44. None
  45. Return Value:
  46. 0 to automatically advance to the next page;
  47. 1 to prevent the page from changing.
  48. To jump to a page other than the next one,
  49. return the identifier of the dialog to be displayed.
  50. --*/
  51. {
  52. ASSERT(m_pCert != NULL);
  53. int id;
  54. switch (m_ContinuationFlag)
  55. {
  56. case CONTINUE_NEW_CERT:
  57. id = IDD_PAGE_NEXT_NEW;
  58. break;
  59. case CONTINUE_PENDING_CERT:
  60. id = IDD_PAGE_NEXT_PENDING;
  61. break;
  62. case CONTINUE_INSTALLED_CERT:
  63. id = IDD_PAGE_NEXT_INSTALLED;
  64. break;
  65. default:
  66. id = 1;
  67. }
  68. return id;
  69. }
  70. BOOL
  71. CWelcomePage::OnSetActive()
  72. /*++
  73. Routine Description:
  74. Activation handler
  75. Arguments:
  76. None
  77. Return Value:
  78. TRUE for success, FALSE for failure
  79. --*/
  80. {
  81. SetWizardButtons(PSWIZB_NEXT);
  82. return CIISWizardBookEnd2::OnSetActive();
  83. }
  84. BOOL CWelcomePage::OnInitDialog()
  85. {
  86. ASSERT(!m_pCert->m_MachineName.IsEmpty());
  87. ASSERT(!m_pCert->m_WebSiteInstanceName.IsEmpty());
  88. // check status of web server
  89. // set status flag
  90. UINT id;
  91. if (m_pCert->HasPendingRequest())
  92. {
  93. m_ContinuationFlag = CONTINUE_PENDING_CERT;
  94. id = IDS_PENDING_REQUEST;
  95. }
  96. else if (m_pCert->HasInstalledCert())
  97. {
  98. m_ContinuationFlag = CONTINUE_INSTALLED_CERT;
  99. id = IDS_INSTALLED_CERT;
  100. }
  101. else
  102. {
  103. m_ContinuationFlag = CONTINUE_NEW_CERT;
  104. id = IDS_NEW_CERT;
  105. }
  106. m_pCert->SetBodyTextID(id);
  107. return CIISWizardBookEnd2::OnInitDialog();
  108. }