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.

211 lines
7.5 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1997 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // BasePage.h
  7. //
  8. // Abstract:
  9. // Definition of the CBasePropertyPage class. This class provides base
  10. // functionality for extension DLL property pages.
  11. //
  12. // Implementation File:
  13. // BasePage.cpp
  14. // BasePage.inl
  15. //
  16. // Author:
  17. // David Potter (davidp) June 28, 1996
  18. //
  19. // Revision History:
  20. //
  21. // Notes:
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #ifndef _BASEPAGE_H_
  25. #define _BASEPAGE_H_
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Include Files
  28. /////////////////////////////////////////////////////////////////////////////
  29. #ifndef _cluadmex_h__
  30. #include <CluAdmEx.h>
  31. #endif
  32. #ifndef _DLGHELP_H_
  33. #include "DlgHelp.h" // for CDialogHelp
  34. #endif
  35. #ifndef _PROPLIST_H_
  36. #include "PropList.h" // for CClusPropList, CObjectProperty
  37. #endif
  38. /////////////////////////////////////////////////////////////////////////////
  39. // Forward Class Declarations
  40. /////////////////////////////////////////////////////////////////////////////
  41. class CBasePropertyPage;
  42. /////////////////////////////////////////////////////////////////////////////
  43. // External Class Declarations
  44. /////////////////////////////////////////////////////////////////////////////
  45. class CExtObject;
  46. interface IWCWizardCallback;
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CBasePropertyPage dialog
  49. /////////////////////////////////////////////////////////////////////////////
  50. class CBasePropertyPage : public CPropertyPage
  51. {
  52. DECLARE_DYNCREATE(CBasePropertyPage)
  53. // Construction
  54. public:
  55. CBasePropertyPage(void);
  56. CBasePropertyPage(
  57. IN const CMapCtrlToHelpID * pmap
  58. );
  59. CBasePropertyPage(
  60. IN const CMapCtrlToHelpID * pmap,
  61. IN UINT nIDTemplate,
  62. IN UINT nIDCaption = 0
  63. );
  64. virtual ~CBasePropertyPage(void) { }
  65. // Second phase construction.
  66. virtual BOOL BInit(IN OUT CExtObject * peo);
  67. protected:
  68. void CommonConstruct(void);
  69. // Attributes
  70. protected:
  71. CExtObject * m_peo;
  72. HPROPSHEETPAGE m_hpage;
  73. IDD m_iddPropertyPage;
  74. IDD m_iddWizardPage;
  75. IDC m_idcPPTitle;
  76. IDS m_idsCaption;
  77. CExtObject * Peo(void) const { return m_peo; }
  78. HPROPSHEETPAGE Hpage(void) const { return m_hpage; }
  79. IDD IddPropertyPage(void) const { return m_iddPropertyPage; }
  80. IDD IddWizardPage(void) const { return m_iddWizardPage; }
  81. IDS IdsCaption(void) const { return m_idsCaption; }
  82. public:
  83. void SetHpage(IN OUT HPROPSHEETPAGE hpage) { m_hpage = hpage; }
  84. // Dialog Data
  85. //{{AFX_DATA(CBasePropertyPage)
  86. enum { IDD = 0 };
  87. //}}AFX_DATA
  88. CStatic m_staticIcon;
  89. CStatic m_staticTitle;
  90. CString m_strTitle;
  91. // Overrides
  92. // ClassWizard generate virtual function overrides
  93. //{{AFX_VIRTUAL(CBasePropertyPage)
  94. public:
  95. virtual BOOL OnSetActive();
  96. virtual BOOL OnApply();
  97. virtual LRESULT OnWizardBack();
  98. virtual LRESULT OnWizardNext();
  99. virtual BOOL OnWizardFinish();
  100. protected:
  101. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  102. //}}AFX_VIRTUAL
  103. virtual DWORD DwParseUnknownProperty(
  104. IN LPCWSTR pwszName,
  105. IN const CLUSPROP_BUFFER_HELPER & rvalue
  106. ) { return ERROR_SUCCESS; }
  107. virtual BOOL BApplyChanges(void);
  108. virtual void BuildPropList(IN OUT CClusPropList & rcpl);
  109. virtual const CObjectProperty * Pprops(void) const { return NULL; }
  110. virtual DWORD Cprops(void) const { return 0; }
  111. // Implementation
  112. protected:
  113. BOOL m_bBackPressed;
  114. BOOL m_bDoDetach;
  115. BOOL BBackPressed(void) const { return m_bBackPressed; }
  116. IWCWizardCallback * PiWizardCallback(void) const;
  117. BOOL BWizard(void) const;
  118. HCLUSTER Hcluster(void) const;
  119. void EnableNext(IN BOOL bEnable = TRUE);
  120. DWORD DwParseProperties(IN const CClusPropList & rcpl);
  121. DWORD DwSetPrivateProps(IN const CClusPropList & rcpl);
  122. DWORD DwReadValue(
  123. IN LPCTSTR pszValueName,
  124. OUT CString & rstrValue,
  125. IN HKEY hkey
  126. );
  127. DWORD DwReadValue(
  128. IN LPCTSTR pszValueName,
  129. OUT DWORD * pdwValue,
  130. IN HKEY hkey
  131. );
  132. DWORD DwReadValue(
  133. IN LPCTSTR pszValueName,
  134. OUT LPBYTE * ppbValue,
  135. IN HKEY hkey
  136. );
  137. DWORD DwWriteValue(
  138. IN LPCTSTR pszValueName,
  139. IN const CString & rstrValue,
  140. IN OUT CString & rstrPrevValue,
  141. IN HKEY hkey
  142. );
  143. DWORD DwWriteValue(
  144. IN LPCTSTR pszValueName,
  145. IN DWORD dwValue,
  146. IN OUT DWORD * pdwPrevValue,
  147. IN HKEY hkey
  148. );
  149. DWORD DwWriteValue(
  150. IN LPCTSTR pszValueName,
  151. IN const LPBYTE pbValue,
  152. IN DWORD cbValue,
  153. IN OUT LPBYTE * ppbPrevValue,
  154. IN DWORD cbPrevValue,
  155. IN HKEY hkey
  156. );
  157. void SetHelpMask(IN DWORD dwMask) { m_dlghelp.SetHelpMask(dwMask); }
  158. CDialogHelp m_dlghelp;
  159. // Generated message map functions
  160. //{{AFX_MSG(CBasePropertyPage)
  161. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  162. afx_msg void OnDestroy();
  163. virtual BOOL OnInitDialog();
  164. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  165. afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
  166. //}}AFX_MSG
  167. virtual afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  168. afx_msg void OnChangeCtrl();
  169. DECLARE_MESSAGE_MAP()
  170. }; //*** class CBasePropertyPage
  171. /////////////////////////////////////////////////////////////////////////////
  172. // CPageList
  173. /////////////////////////////////////////////////////////////////////////////
  174. typedef CList<CBasePropertyPage *, CBasePropertyPage *> CPageList;
  175. /////////////////////////////////////////////////////////////////////////////
  176. #endif // _BASEPAGE_H_