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.

94 lines
2.0 KiB

  1. // ManageCertPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CertWiz.h"
  5. #include "ManageCertPage.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. // CManageCertPage property page
  14. IMPLEMENT_DYNCREATE(CManageCertPage, CIISWizardPage)
  15. CManageCertPage::CManageCertPage(CCertificate * pCert)
  16. : CIISWizardPage(CManageCertPage::IDD, IDS_CERTWIZ, TRUE),
  17. m_pCert(pCert)
  18. {
  19. //{{AFX_DATA_INIT(CManageCertPage)
  20. m_Index = -1;
  21. //}}AFX_DATA_INIT
  22. }
  23. CManageCertPage::~CManageCertPage()
  24. {
  25. }
  26. void CManageCertPage::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CIISWizardPage::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CManageCertPage)
  30. DDX_Radio(pDX, IDC_RENEW_CERT, m_Index);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CManageCertPage, CIISWizardPage)
  34. //{{AFX_MSG_MAP(CManageCertPage)
  35. //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CManageCertPage message handlers
  39. LRESULT CManageCertPage::OnWizardBack()
  40. {
  41. return IDD_PAGE_PREV;
  42. }
  43. LRESULT CManageCertPage::OnWizardNext()
  44. {
  45. LRESULT res = 1;
  46. UpdateData();
  47. switch (m_Index)
  48. {
  49. case CONTINUE_RENEW:
  50. m_pCert->SetStatusCode(CCertificate::REQUEST_RENEW_CERT);
  51. res = IDD_PAGE_NEXT_RENEW;
  52. break;
  53. case CONTINUE_REMOVE:
  54. res = IDD_PAGE_NEXT_REMOVE;
  55. break;
  56. case CONTINUE_REPLACE:
  57. m_pCert->SetStatusCode(CCertificate::REQUEST_REPLACE_CERT);
  58. res = IDD_PAGE_NEXT_REPLACE;
  59. break;
  60. }
  61. return res;
  62. }
  63. BOOL CManageCertPage::OnSetActive()
  64. {
  65. m_pCert->SetStatusCode(CCertificate::REQUEST_UNDEFINED);
  66. SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  67. return CIISWizardPage::OnSetActive();
  68. }
  69. BOOL CManageCertPage::OnInitDialog()
  70. {
  71. m_Index = 0;
  72. CIISWizardPage::OnInitDialog();
  73. // we should make some checks and disable some buttons
  74. if (m_pCert->MyStoreCertCount() == 0)
  75. {
  76. ASSERT(NULL != GetDlgItem(IDC_REPLACE_CERT));
  77. GetDlgItem(IDC_REPLACE_CERT)->EnableWindow(FALSE);
  78. }
  79. return TRUE;
  80. }