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.

234 lines
8.8 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-2000 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 DWORD * pdwHelpMap,
  58. IN const DWORD * pdwWizardHelpMap
  59. );
  60. CBasePropertyPage(
  61. IN UINT idd,
  62. IN const DWORD * pdwHelpMap,
  63. IN const DWORD * pdwWizardHelpMap,
  64. IN UINT nIDCaption = 0
  65. );
  66. virtual ~CBasePropertyPage( void ) { }
  67. // Second phase construction.
  68. virtual HRESULT HrInit( IN OUT CExtObject * peo );
  69. protected:
  70. void CommonConstruct( void );
  71. // Attributes
  72. protected:
  73. CExtObject * m_peo;
  74. HPROPSHEETPAGE m_hpage;
  75. IDD m_iddPropertyPage;
  76. IDD m_iddWizardPage;
  77. IDS m_idsCaption;
  78. CExtObject * Peo( void ) const { return m_peo; }
  79. HPROPSHEETPAGE Hpage( void ) const { return m_hpage; }
  80. IDD IddPropertyPage( void ) const { return m_iddPropertyPage; }
  81. IDD IddWizardPage( void ) const { return m_iddWizardPage; }
  82. IDS IdsCaption( void ) const { return m_idsCaption; }
  83. public:
  84. void SetHpage( IN OUT HPROPSHEETPAGE hpage ) { m_hpage = hpage; }
  85. // Dialog Data
  86. //{{AFX_DATA(CBasePropertyPage)
  87. enum { IDD = 0 };
  88. //}}AFX_DATA
  89. CStatic m_staticIcon;
  90. CStatic m_staticTitle;
  91. CString m_strTitle;
  92. // Overrides
  93. // ClassWizard generate virtual function overrides
  94. //{{AFX_VIRTUAL(CBasePropertyPage)
  95. public:
  96. virtual BOOL OnSetActive();
  97. virtual BOOL OnApply();
  98. virtual LRESULT OnWizardBack();
  99. virtual LRESULT OnWizardNext();
  100. virtual BOOL OnWizardFinish();
  101. protected:
  102. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  103. //}}AFX_VIRTUAL
  104. virtual DWORD ScParseUnknownProperty(
  105. IN LPCWSTR pwszName,
  106. IN const CLUSPROP_BUFFER_HELPER & rvalue,
  107. IN DWORD cbBuf
  108. ) { return ERROR_SUCCESS; }
  109. virtual BOOL BApplyChanges( void );
  110. virtual BOOL BBuildPropList( IN OUT CClusPropList & rcpl, IN BOOL bNoNewProps = FALSE );
  111. virtual void DisplaySetPropsError( IN DWORD sc, IN UINT idsOper ) const;
  112. virtual const CObjectProperty * Pprops( void ) const { return NULL; }
  113. virtual DWORD Cprops( void ) const { return 0; }
  114. // Implementation
  115. protected:
  116. BOOL m_bBackPressed;
  117. BOOL m_bSaved;
  118. const DWORD * m_pdwWizardHelpMap;
  119. BOOL m_bDoDetach;
  120. BOOL BGetClusterNetworkNameNode( OUT CString & rstrNode );
  121. BOOL BBackPressed( void ) const { return m_bBackPressed; }
  122. BOOL BSaved( void ) const { return m_bSaved; }
  123. IWCWizardCallback * PiWizardCallback( void ) const;
  124. BOOL BWizard( void ) const;
  125. HCLUSTER Hcluster( void ) const;
  126. void EnableNext( IN BOOL bEnable = TRUE );
  127. BOOL BRequiredDependenciesPresent( void );
  128. DWORD ScParseProperties( IN CClusPropList & rcpl );
  129. BOOL BSetPrivateProps(
  130. IN BOOL bValidateOnly = FALSE,
  131. IN BOOL bNoNewProps = FALSE
  132. );
  133. DWORD ScReadValue(
  134. IN LPCTSTR pszValueName,
  135. OUT CString & rstrValue,
  136. IN HKEY hkey
  137. );
  138. DWORD ScReadValue(
  139. IN LPCTSTR pszValueName,
  140. OUT DWORD * pdwValue,
  141. IN HKEY hkey
  142. );
  143. DWORD ScReadValue(
  144. IN LPCTSTR pszValueName,
  145. OUT LPBYTE * ppbValue,
  146. IN HKEY hkey
  147. );
  148. DWORD ScWriteValue(
  149. IN LPCTSTR pszValueName,
  150. IN const CString & rstrValue,
  151. IN OUT CString & rstrPrevValue,
  152. IN HKEY hkey
  153. );
  154. DWORD ScWriteValue(
  155. IN LPCTSTR pszValueName,
  156. IN DWORD dwValue,
  157. IN OUT DWORD * pdwPrevValue,
  158. IN HKEY hkey
  159. );
  160. DWORD ScWriteValue(
  161. IN LPCTSTR pszValueName,
  162. IN const LPBYTE pbValue,
  163. IN DWORD cbValue,
  164. IN OUT LPBYTE * ppbPrevValue,
  165. IN DWORD cbPrevValue,
  166. IN HKEY hkey
  167. );
  168. void SetHelpMask( IN DWORD dwMask ) { m_dlghelp.SetHelpMask(dwMask); }
  169. CDialogHelp m_dlghelp;
  170. void ConstructDefaultDirectory(
  171. OUT CString & rstrDir,
  172. IN IDS idsFormat
  173. );
  174. HRESOURCE GetDependentStorageResource( void );
  175. void GetResTypeDisplayOrTypeName(
  176. IN LPCWSTR pszResTypeNameIn,
  177. IN OUT CString * pstrResTypeDisplayNameInOut
  178. );
  179. // Generated message map functions
  180. //{{AFX_MSG(CBasePropertyPage)
  181. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  182. afx_msg void OnDestroy();
  183. virtual BOOL OnInitDialog();
  184. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  185. afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
  186. //}}AFX_MSG
  187. virtual afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  188. afx_msg void OnChangeCtrl();
  189. DECLARE_MESSAGE_MAP()
  190. }; //*** class CBasePropertyPage
  191. /////////////////////////////////////////////////////////////////////////////
  192. // CPageList
  193. /////////////////////////////////////////////////////////////////////////////
  194. typedef CList< CBasePropertyPage *, CBasePropertyPage * > CPageList;
  195. /////////////////////////////////////////////////////////////////////////////
  196. #endif // _BASEPAGE_H_