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.

286 lines
6.7 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. // Implementation
  39. protected:
  40. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  41. // This mechanism deletes the CAutoDeletePropPage object
  42. // when the wizard is finished
  43. struct
  44. {
  45. INT cWizPages; // Number of pages in wizard
  46. LPFNPSPCALLBACK pfnOriginalPropSheetPageProc;
  47. } m_autodeleteStuff;
  48. static UINT CALLBACK S_PropSheetPageProc(HWND hwnd, UINT uMsg, LPPROPSHEETPAGE ppsp);
  49. protected:
  50. CString m_strHelpFile; // Name for the .hlp file
  51. CString m_strCaption; // Name for the .hlp file
  52. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  53. public:
  54. void SetCaption(UINT uStringID);
  55. void SetCaption(LPCTSTR pszCaption);
  56. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  57. void EnableDlgItem(INT nIdDlgItem, BOOL fEnable);
  58. }; // CAutoDeletePropPage
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CGeneralPage dialog
  61. class CGeneralPage : public CAutoDeletePropPage
  62. {
  63. public:
  64. enum { IID_DEFAULT = IDD_GENERAL };
  65. // Construction
  66. public:
  67. CGeneralPage(UINT uIDD = IID_DEFAULT);
  68. ~CGeneralPage();
  69. // Dialog Data
  70. // Overrides
  71. public:
  72. BOOL OnApply();
  73. protected:
  74. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  75. // Implementation
  76. protected:
  77. void OnDestroy();
  78. void OnEditChange();
  79. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  80. public:
  81. LONG_PTR m_hConsoleHandle; // Handle given to the snap-in by the console
  82. private:
  83. BOOL m_bUpdate;
  84. };
  85. //////////////////////////////
  86. // hand-hewn pages
  87. class CPolicySettingsGeneralPage : public CAutoDeletePropPage
  88. {
  89. public:
  90. enum { IID_DEFAULT = IDD_POLICYSETTINGS_PROPPAGE1 };
  91. // Construction
  92. public:
  93. CPolicySettingsGeneralPage(CString szCAName, HCAINFO hCAInfo, UINT uIDD = IID_DEFAULT);
  94. ~CPolicySettingsGeneralPage();
  95. // Dialog Data
  96. CString m_szCAName;
  97. CComboBox m_cboxDurationUnits;
  98. HCAINFO m_hCAInfo;
  99. // Overrides
  100. public:
  101. BOOL OnApply();
  102. BOOL OnInitDialog();
  103. protected:
  104. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  105. // Implementation
  106. protected:
  107. void OnDestroy();
  108. void OnEditChange();
  109. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  110. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  111. public:
  112. long m_hConsoleHandle; // Handle given to the snap-in by the console
  113. private:
  114. BOOL m_bUpdate;
  115. };
  116. #include <gpedit.h>
  117. //////////////////////////////
  118. // hand-hewn pages
  119. class CGlobalCertTemplateCSPPage : public CAutoDeletePropPage
  120. {
  121. public:
  122. enum { IID_DEFAULT = IDD_GLOBAL_TEMPLATE_PROPERTIES };
  123. // Construction
  124. public:
  125. CGlobalCertTemplateCSPPage(IGPEInformation *pGPTInformation, UINT uIDD = IID_DEFAULT);
  126. ~CGlobalCertTemplateCSPPage();
  127. // Dialog Data
  128. HWND m_hwndCSPList;
  129. // Overrides
  130. public:
  131. BOOL OnApply();
  132. BOOL OnInitDialog();
  133. protected:
  134. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  135. // Implementation
  136. protected:
  137. void OnAddButton();
  138. void OnRemoveButton();
  139. void OnDestroy();
  140. void OnSelChange(NMHDR * pNotifyStruct);
  141. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  142. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  143. public:
  144. long m_hConsoleHandle; // Handle given to the snap-in by the console
  145. private:
  146. BOOL m_bUpdate;
  147. IGPEInformation * m_pGPTInformation;
  148. BOOL CSPDoesntExist(LPWSTR);
  149. };
  150. /////////////////////////////////////////
  151. // CCertTemplateGeneralPage
  152. class CCertTemplateGeneralPage : public CAutoDeletePropPage
  153. {
  154. public:
  155. enum { IID_DEFAULT = IDD_CERTIFICATE_TEMPLATE_PROPERTIES_GENERAL_PAGE };
  156. // Construction
  157. public:
  158. CCertTemplateGeneralPage(HCERTTYPE hCertType, UINT uIDD = IID_DEFAULT);
  159. ~CCertTemplateGeneralPage();
  160. void SetItemTextWrapper(UINT nID, int *piItem, BOOL fDoInsert, BOOL *pfFirstUsageItem);
  161. // Dialog Data
  162. HWND m_hwndPurposesList;
  163. HWND m_hwndOtherInfoList;
  164. // Overrides
  165. public:
  166. BOOL OnApply();
  167. BOOL OnInitDialog();
  168. protected:
  169. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  170. // Implementation
  171. protected:
  172. void OnDestroy();
  173. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  174. public:
  175. LONG_PTR m_hConsoleHandle; // Handle given to the snap-in by the console
  176. HCERTTYPE m_hCertType;
  177. private:
  178. BOOL m_bUpdate;
  179. };
  180. /////////////////////////////////////////
  181. // CCertTemplateSelectPage
  182. INT_PTR SelectCertTemplateDialogProc(
  183. HWND hwndDlg,
  184. UINT uMsg,
  185. WPARAM wParam,
  186. LPARAM lParam);
  187. class CCertTemplateSelectDialog
  188. {
  189. // Construction
  190. public:
  191. CCertTemplateSelectDialog(HWND hParent = NULL);
  192. ~CCertTemplateSelectDialog();
  193. // Dialog Data
  194. enum { IDD = IDD_SELECT_CERTIFICATE_TEMPLATE };
  195. HWND m_hDlg;
  196. HWND m_hwndCertTypeList;
  197. // Overrides
  198. public:
  199. BOOL OnInitDialog(HWND hDlg);
  200. void OnOK();
  201. void OnHelp(LPHELPINFO lpHelp);
  202. void OnContextHelp(HWND hwnd);
  203. protected:
  204. BOOL UpdateData(BOOL fSuckFromDlg = TRUE);
  205. public:
  206. void SetCA(HCAINFO hCAInfo, bool fAdvancedServer);
  207. void SetHelp(LPCTSTR szHelpFile, const DWORD rgzHelpIDs[]);
  208. // Implementation
  209. //protected:
  210. public:
  211. void OnDestroy();
  212. void OnSelChange(NMHDR * pNotifyStruct);
  213. BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  214. BOOL OnNotify(UINT idCtrl, NMHDR* pnmh);
  215. protected:
  216. CString m_strHelpFile; // Name for the .hlp file
  217. const DWORD * m_prgzHelpIDs; // Optional: Pointer to an array of help IDs
  218. bool m_fAdvancedServer;
  219. CTemplateList m_TemplateList;
  220. public:
  221. HCAINFO m_hCAInfo;
  222. };
  223. #endif // _GENPAGE_H