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.

237 lines
6.4 KiB

  1. #if !defined(AFX_SCOPEPANE_H__7D4A6859_9056_11D2_BD45_0000F87A3912__INCLUDED_)
  2. #define AFX_SCOPEPANE_H__7D4A6859_9056_11D2_BD45_0000F87A3912__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ScopePane.h : header file
  7. //
  8. #include <mmc.h>
  9. #include "ScopePaneItem.h"
  10. #include "ResultsPaneItem.h"
  11. #include "ResultsPaneView.h"
  12. #include "ResultsPane.h"
  13. #include "SnapinDataObject.h"
  14. #include "MmcMsgHook.h"
  15. typedef CTypedPtrArray<CObArray,CResultsPane*> ResultsPaneArray;
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CScopePane command target
  18. class CScopePane : public CCmdTarget
  19. {
  20. DECLARE_DYNCREATE(CScopePane)
  21. // Construction/Destruction
  22. public:
  23. CScopePane();
  24. virtual ~CScopePane();
  25. // Creation/Destruction Overrideable Members
  26. protected:
  27. virtual bool OnCreate();
  28. virtual LPCOMPONENT OnCreateComponent();
  29. virtual bool OnDestroy();
  30. // Root Scope Pane Item Members
  31. public:
  32. virtual CScopePaneItem* CreateRootScopeItem();
  33. CScopePaneItem* GetRootScopeItem();
  34. void SetRootScopeItem(CScopePaneItem* pRootItem);
  35. protected:
  36. CScopePaneItem* m_pRootItem;
  37. // MMC Frame Window Message Hook Members
  38. public:
  39. bool HookWindow();
  40. void UnhookWindow();
  41. protected:
  42. CMmcMsgHook* m_pMsgHook;
  43. // MMC Interface Members
  44. public:
  45. LPCONSOLENAMESPACE2 GetConsoleNamespacePtr();
  46. LPCONSOLE2 GetConsolePtr();
  47. LPIMAGELIST GetImageListPtr();
  48. LPUNKNOWN GetCustomOcxPtr();
  49. protected:
  50. LPCONSOLENAMESPACE2 m_pIConsoleNamespace;
  51. LPCONSOLE2 m_pIConsole;
  52. LPIMAGELIST m_pIImageList;
  53. // MMC Scope Pane Helper Members
  54. public:
  55. CScopePaneItem* GetSelectedScopeItem();
  56. void SetSelectedScopeItem(CScopePaneItem* pItem);
  57. protected:
  58. CScopePaneItem* m_pSelectedScopeItem;
  59. // Scope Item Icon Management
  60. public:
  61. int AddIcon(UINT nIconResID);
  62. int GetIconIndex(UINT nIconResID);
  63. int GetIconCount();
  64. void RemoveAllIcons();
  65. protected:
  66. CMap<UINT,UINT,int,int> m_IconMap;
  67. // Results Pane Members
  68. public:
  69. int GetResultsPaneCount() const;
  70. CResultsPane* GetResultsPane(int iIndex);
  71. int AddResultsPane(CResultsPane* pPane);
  72. void RemoveResultsPane(int iIndex);
  73. protected:
  74. ResultsPaneArray m_ResultsPanes;
  75. // Serialization
  76. public:
  77. virtual bool OnLoad(CArchive& ar);
  78. virtual bool OnSave(CArchive& ar);
  79. // MMC Help
  80. public:
  81. bool ShowTopic(const CString& sHelpTopic);
  82. // MFC Operations
  83. public:
  84. // Overrides
  85. // ClassWizard generated virtual function overrides
  86. //{{AFX_VIRTUAL(CScopePane)
  87. public:
  88. virtual void OnFinalRelease();
  89. //}}AFX_VIRTUAL
  90. // MFC Implementation
  91. protected:
  92. // Generated message map functions
  93. //{{AFX_MSG(CScopePane)
  94. // NOTE - the ClassWizard will add and remove member functions here.
  95. //}}AFX_MSG
  96. DECLARE_MESSAGE_MAP()
  97. // Generated OLE dispatch map functions
  98. //{{AFX_DISPATCH(CScopePane)
  99. // NOTE - the ClassWizard will add and remove member functions here.
  100. //}}AFX_DISPATCH
  101. DECLARE_DISPATCH_MAP()
  102. DECLARE_INTERFACE_MAP()
  103. ////////////////////////////////
  104. // IComponentData Interface Part
  105. BEGIN_INTERFACE_PART(ComponentData,IComponentData)
  106. /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  107. /* [in] */ LPUNKNOWN pUnknown);
  108. /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
  109. /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
  110. /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
  111. /* [in] */ LPDATAOBJECT lpDataObject,
  112. /* [in] */ MMC_NOTIFY_TYPE event,
  113. /* [in] */ LPARAM arg,
  114. /* [in] */ LPARAM param);
  115. /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
  116. /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
  117. /* [in] */ MMC_COOKIE cookie,
  118. /* [in] */ DATA_OBJECT_TYPES type,
  119. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  120. /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
  121. /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
  122. /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
  123. /* [in] */ LPDATAOBJECT lpDataObjectA,
  124. /* [in] */ LPDATAOBJECT lpDataObjectB);
  125. END_INTERFACE_PART(ComponentData)
  126. ////////////////////////////////
  127. // IPersistStream Interface Part
  128. BEGIN_INTERFACE_PART(PersistStream,IPersistStream)
  129. HRESULT STDMETHODCALLTYPE GetClassID(
  130. /* [out] */ CLSID __RPC_FAR *pClassID);
  131. HRESULT STDMETHODCALLTYPE IsDirty( void);
  132. HRESULT STDMETHODCALLTYPE Load(
  133. /* [unique][in] */ IStream __RPC_FAR *pStm);
  134. HRESULT STDMETHODCALLTYPE Save(
  135. /* [unique][in] */ IStream __RPC_FAR *pStm,
  136. /* [in] */ BOOL fClearDirty);
  137. HRESULT STDMETHODCALLTYPE GetSizeMax(
  138. /* [out] */ ULARGE_INTEGER __RPC_FAR *pcbSize);
  139. END_INTERFACE_PART(PersistStream)
  140. ////////////////////////////////
  141. // IExtendContextMenu Interface Part
  142. BEGIN_INTERFACE_PART(ExtendContextMenu,IExtendContextMenu)
  143. /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddMenuItems(
  144. /* [in] */ LPDATAOBJECT piDataObject,
  145. /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
  146. /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
  147. /* [helpstring] */ HRESULT STDMETHODCALLTYPE Command(
  148. /* [in] */ long lCommandID,
  149. /* [in] */ LPDATAOBJECT piDataObject);
  150. END_INTERFACE_PART(ExtendContextMenu)
  151. ////////////////////////////////
  152. // IExtendPropertySheet2 Interface Part
  153. BEGIN_INTERFACE_PART(ExtendPropertySheet2,IExtendPropertySheet2)
  154. /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreatePropertyPages(
  155. /* [in] */ LPPROPERTYSHEETCALLBACK lpProvider,
  156. /* [in] */ LONG_PTR handle,
  157. /* [in] */ LPDATAOBJECT lpIDataObject);
  158. /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryPagesFor(
  159. /* [in] */ LPDATAOBJECT lpDataObject);
  160. /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWatermarks(
  161. /* [in] */ LPDATAOBJECT lpIDataObject,
  162. /* [out] */ HBITMAP __RPC_FAR *lphWatermark,
  163. /* [out] */ HBITMAP __RPC_FAR *lphHeader,
  164. /* [out] */ HPALETTE __RPC_FAR *lphPalette,
  165. /* [out] */ BOOL __RPC_FAR *bStretch);
  166. END_INTERFACE_PART(ExtendPropertySheet2)
  167. ////////////////////////////////
  168. // ISnapinHelp Interface Part
  169. BEGIN_INTERFACE_PART(SnapinHelp,ISnapinHelp)
  170. /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetHelpTopic(
  171. /* [out] */ LPOLESTR __RPC_FAR *lpCompiledHelpFile);
  172. END_INTERFACE_PART(SnapinHelp)
  173. };
  174. /////////////////////////////////////////////////////////////////////////////
  175. //{{AFX_INSERT_LOCATION}}
  176. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  177. #endif // !defined(AFX_SCOPEPANE_H__7D4A6859_9056_11D2_BD45_0000F87A3912__INCLUDED_)