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.

176 lines
4.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: genpage.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _GENPAGE_H
  11. #define _GENPAGE_H
  12. // genpage.h : header file
  13. //
  14. #include <tfcprop.h>
  15. /////////////////////////////////////////////////////////////////////
  16. /////////////////////////////////////////////////////////////////////
  17. // class CAutoDeletePropPage
  18. //
  19. // This object is the backbone for property page
  20. // that will *destroy* itself when no longer needed.
  21. // The purpose of this object is to maximize code reuse
  22. // among the various pages in the snapin wizards.
  23. //
  24. //
  25. class CAutoDeletePropPage : public PropertyPage
  26. {
  27. public:
  28. // Construction
  29. CAutoDeletePropPage(UINT uIDD);
  30. virtual ~CAutoDeletePropPage();
  31. protected:
  32. // Dialog Data
  33. // Overrides
  34. virtual BOOL OnSetActive();
  35. virtual BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  36. void OnHelp(LPHELPINFO lpHelp);
  37. void OnContextHelp(HWND hwnd);
  38. bool HasContextHelp(int nDlgItem);
  39. // Implementation
  40. protected:
  41. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  42. // This mechanism deletes the CAutoDeletePropPage object
  43. // when the wizard is finished
  44. struct
  45. {
  46. INT cWizPages; // Number of pages in wizard
  47. LPFNPSPCALLBACK pfnOriginalPropSheetPageProc;
  48. } m_autodeleteStuff;
  49. static UINT CALLBACK S_PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  50. protected:
  51. CString m_strHelpFile; // Name for the .hlp file
  52. CString m_strCaption; // Name for the .hlp file
  53. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  54. public:
  55. void SetCaption(UINT uStringID);
  56. void SetCaption(LPCTSTR pszCaption);
  57. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  58. void EnableDlgItem(INT nIdDlgItem, BOOL fEnable);
  59. }; // CAutoDeletePropPage
  60. #include <gpedit.h>
  61. //////////////////////////////
  62. // hand-hewn pages
  63. /////////////////////////////////////////
  64. // CCertTemplateGeneralPage
  65. class CCertTemplateGeneralPage : public CAutoDeletePropPage
  66. {
  67. public:
  68. enum { IID_DEFAULT = IDD_CERTIFICATE_TEMPLATE_PROPERTIES_GENERAL_PAGE };
  69. // Construction
  70. public:
  71. CCertTemplateGeneralPage(HCERTTYPE hCertType, UINT uIDD = IID_DEFAULT);
  72. ~CCertTemplateGeneralPage();
  73. void SetItemTextWrapper(UINT nID, int *piItem, BOOL fDoInsert, BOOL *pfFirstUsageItem);
  74. // Dialog Data
  75. HWND m_hwndPurposesList;
  76. HWND m_hwndOtherInfoList;
  77. // Overrides
  78. public:
  79. BOOL OnApply();
  80. BOOL OnInitDialog();
  81. protected:
  82. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  83. // Implementation
  84. protected:
  85. void OnDestroy();
  86. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  87. public:
  88. LONG_PTR m_hConsoleHandle; // Handle given to the snap-in by the console
  89. HCERTTYPE m_hCertType;
  90. private:
  91. BOOL m_bUpdate;
  92. };
  93. /////////////////////////////////////////
  94. // CCertTemplateSelectPage
  95. INT_PTR SelectCertTemplateDialogProc(
  96. HWND hwndDlg,
  97. UINT uMsg,
  98. WPARAM wParam,
  99. LPARAM lParam);
  100. class CCertTemplateSelectDialog
  101. {
  102. // Construction
  103. public:
  104. CCertTemplateSelectDialog(HWND hParent = NULL);
  105. ~CCertTemplateSelectDialog();
  106. // Dialog Data
  107. enum { IDD = IDD_SELECT_CERTIFICATE_TEMPLATE };
  108. HWND m_hDlg;
  109. HWND m_hwndCertTypeList;
  110. // Overrides
  111. public:
  112. BOOL OnInitDialog(HWND hDlg);
  113. void OnOK();
  114. void OnHelp(LPHELPINFO lpHelp);
  115. void OnContextHelp(HWND hwnd);
  116. bool HasContextHelp(int nDlgItem);
  117. protected:
  118. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  119. public:
  120. void SetCA(HCAINFO hCAInfo, bool fAdvancedServer);
  121. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  122. // Implementation
  123. //protected:
  124. public:
  125. void OnDestroy();
  126. void OnSelChange(NMHDR * pNotifyStruct);
  127. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  128. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  129. protected:
  130. CString m_strHelpFile; // Name for the .hlp file
  131. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  132. bool m_fAdvancedServer;
  133. CTemplateList m_TemplateList;
  134. public:
  135. HCAINFO m_hCAInfo;
  136. };
  137. #endif // _GENPAGE_H