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.

169 lines
4.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 <company name>
  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. //
  15. // Author:
  16. // <name> (<e-mail name>) Mmmm DD, 1996
  17. //
  18. // Revision History:
  19. //
  20. // Notes:
  21. //
  22. /////////////////////////////////////////////////////////////////////////////
  23. #ifndef _BASEPAGE_H_
  24. #define _BASEPAGE_H_
  25. /////////////////////////////////////////////////////////////////////////////
  26. // Include Files
  27. /////////////////////////////////////////////////////////////////////////////
  28. #ifndef _cluadmex_h__
  29. #include <CluAdmEx.h>
  30. #endif
  31. #ifndef _EXTOBJ_H_
  32. #include "ExtObj.h" // for CExtObject
  33. #endif
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Forward Class Declarations
  36. /////////////////////////////////////////////////////////////////////////////
  37. class CBasePropertyPage;
  38. /////////////////////////////////////////////////////////////////////////////
  39. // External Class Declarations
  40. /////////////////////////////////////////////////////////////////////////////
  41. class CExtObject;
  42. interface IWCWizardCallback;
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CBasePropertyPage dialog
  45. /////////////////////////////////////////////////////////////////////////////
  46. class CBasePropertyPage : public CPropertyPage
  47. {
  48. DECLARE_DYNCREATE(CBasePropertyPage)
  49. // Construction
  50. public:
  51. CBasePropertyPage(void);
  52. CBasePropertyPage(IN UINT nIDTemplate, IN UINT nIDCaption = 0);
  53. ~CBasePropertyPage(void);
  54. // Second phase construction.
  55. virtual BOOL BInit(IN OUT CExtObject * peo);
  56. BOOL BCreateParamsKey(void);
  57. protected:
  58. void CommonConstruct(void);
  59. // Attributes
  60. protected:
  61. CExtObject * m_peo;
  62. HPROPSHEETPAGE m_hpage;
  63. HKEY m_hkeyParameters;
  64. IDD m_iddPropertyPage;
  65. IDD m_iddWizardPage;
  66. IDS m_idsCaption;
  67. CExtObject * Peo(void) const { return m_peo; }
  68. HPROPSHEETPAGE Hpage(void) const { return m_hpage; }
  69. HKEY HkeyParameters(void) const { return m_hkeyParameters; }
  70. IDD IddPropertyPage(void) const { return m_iddPropertyPage; }
  71. IDD IddWizardPage(void) const { return m_iddWizardPage; }
  72. IDS IdsCaption(void) const { return m_idsCaption; }
  73. public:
  74. void SetHpage(IN OUT HPROPSHEETPAGE hpage) { m_hpage = hpage; }
  75. // Dialog Data
  76. //{{AFX_DATA(CBasePropertyPage)
  77. enum { IDD = 0 };
  78. //}}AFX_DATA
  79. CStatic m_staticIcon;
  80. CStatic m_staticTitle;
  81. CString m_strTitle;
  82. // Overrides
  83. // ClassWizard generate virtual function overrides
  84. //{{AFX_VIRTUAL(CBasePropertyPage)
  85. public:
  86. virtual BOOL OnSetActive();
  87. virtual BOOL OnApply();
  88. virtual LRESULT OnWizardBack();
  89. virtual LRESULT OnWizardNext();
  90. virtual BOOL OnWizardFinish();
  91. protected:
  92. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  93. //}}AFX_VIRTUAL
  94. virtual BOOL BApplyChanges(void);
  95. // Implementation
  96. protected:
  97. BOOL m_bBackPressed;
  98. BOOL BBackPressed(void) const { return m_bBackPressed; }
  99. IWCWizardCallback * PiWizardCallback(void) const;
  100. BOOL BWizard(void) const;
  101. HCLUSTER Hcluster(void) const;
  102. HKEY Hkey(void) const;
  103. void EnableNext(IN BOOL bEnable = TRUE);
  104. DWORD DwReadValue(
  105. IN LPCTSTR pszValueName,
  106. OUT CString & rstrValue,
  107. IN HKEY hkey = NULL
  108. );
  109. DWORD DwReadValue(
  110. IN LPCTSTR pszValueName,
  111. OUT DWORD * pdwValue,
  112. IN HKEY hkey = NULL
  113. );
  114. DWORD DwWriteValue(
  115. IN LPCTSTR pszValueName,
  116. IN const CString & rstrValue,
  117. IN OUT CString & rstrPrevValue,
  118. IN HKEY hkey = NULL
  119. );
  120. DWORD DwWriteValue(
  121. IN LPCTSTR pszValueName,
  122. IN DWORD dwValue,
  123. IN OUT DWORD * pdwPrevValue,
  124. IN HKEY hkey = NULL
  125. );
  126. // Generated message map functions
  127. //{{AFX_MSG(CBasePropertyPage)
  128. virtual BOOL OnInitDialog();
  129. //}}AFX_MSG
  130. afx_msg void OnChangeCtrl();
  131. DECLARE_MESSAGE_MAP()
  132. }; //*** class CBasePropertyPage
  133. /////////////////////////////////////////////////////////////////////////////
  134. // CPageList
  135. /////////////////////////////////////////////////////////////////////////////
  136. typedef CList<CBasePropertyPage *, CBasePropertyPage *> CPageList;
  137. /////////////////////////////////////////////////////////////////////////////
  138. #endif // _BASEPAGE_H_