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.

129 lines
3.9 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. smonprop.h
  5. Abstract:
  6. Header file for the sysmon property page base class.
  7. --*/
  8. #ifndef _SMONPROP_H_
  9. #define _SMONPROP_H_
  10. #define GUIDS_FROM_TYPELIB
  11. #include "inole.h"
  12. #include <pdh.h>
  13. #define WM_SETPAGEFOCUS (WM_USER+1000)
  14. //Get definitions for the object we work with
  15. #include "isysmon.h"
  16. // Property page indices
  17. enum {
  18. GENERAL_PROPPAGE,
  19. SOURCE_PROPPAGE,
  20. COUNTER_PROPPAGE,
  21. GRAPH_PROPPAGE,
  22. APPEAR_PROPPAGE,
  23. CPROPPAGES
  24. };
  25. #define CCHSTRINGMAX 40
  26. // Class factory for all property pages
  27. class CSysmonPropPageFactory : public IClassFactory
  28. {
  29. protected:
  30. ULONG m_cRef;
  31. INT m_nPageID;
  32. public:
  33. CSysmonPropPageFactory(INT nPageID);
  34. ~CSysmonPropPageFactory(void);
  35. //IUnknown members
  36. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  37. STDMETHODIMP_(ULONG) AddRef(void);
  38. STDMETHODIMP_(ULONG) Release(void);
  39. //IClassPPFactory members
  40. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, PPVOID);
  41. STDMETHODIMP LockServer(BOOL);
  42. };
  43. typedef CSysmonPropPageFactory *PCSysmonPropPageFactory;
  44. // Dialog proc for proprty pages
  45. BOOL APIENTRY SysmonPropPageProc(HWND, UINT, WPARAM, LPARAM);
  46. // Base property page class
  47. class CSysmonPropPage : public IPropertyPage2
  48. {
  49. friend BOOL APIENTRY SysmonPropPageProc(HWND, UINT, WPARAM, LPARAM);
  50. protected:
  51. ULONG m_cRef; //Reference count
  52. UINT m_uIDDialog; //Dialog ID
  53. UINT m_uIDTitle; //Page Title ID
  54. HWND m_hDlg; //Dialog handle
  55. ULONG m_cx; //Dialog size
  56. ULONG m_cy;
  57. UINT m_cObjects; //Number of objects
  58. LCID m_lcid; //Current locale
  59. BOOL m_fActive; //Page is fully active
  60. BOOL m_fDirty; //Page dirty?
  61. INT m_dwEditControl; // Focus if specified by EditProperty
  62. ISystemMonitor **m_ppISysmon; //Objects to notify
  63. IPropertyPageSite *m_pIPropertyPageSite; //Frame's site
  64. void SetChange(void); //Mark page changed
  65. virtual BOOL GetProperties(void) = 0; //Get object properties
  66. virtual BOOL SetProperties(void) = 0; //Put object properties
  67. virtual void DialogItemChange(WORD wId, WORD wMsg) = 0; // Handle item change
  68. virtual void MeasureItem(PMEASUREITEMSTRUCT) {}; // Handle user measure req
  69. virtual void DrawItem(PDRAWITEMSTRUCT) {}; // Handle user draw req
  70. virtual BOOL InitControls(void) // Initialize dialog controls
  71. { return TRUE; }
  72. virtual void DeinitControls(void) {}; // Deinitialize dialog controls
  73. virtual HRESULT EditPropertyImpl( DISPID ) { return E_NOTIMPL; }; // Set focus control
  74. virtual BOOL WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam); // Special msg processing
  75. public:
  76. CSysmonPropPage(void);
  77. virtual ~CSysmonPropPage(void);
  78. virtual BOOL Init(void);
  79. void FreeAllObjects(void);
  80. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  81. STDMETHODIMP_(ULONG) AddRef(void);
  82. STDMETHODIMP_(ULONG) Release(void);
  83. STDMETHODIMP SetPageSite(LPPROPERTYPAGESITE);
  84. STDMETHODIMP Activate(HWND, LPCRECT, BOOL);
  85. STDMETHODIMP Deactivate(void);
  86. STDMETHODIMP GetPageInfo(LPPROPPAGEINFO);
  87. STDMETHODIMP SetObjects(ULONG, LPUNKNOWN *);
  88. STDMETHODIMP Show(UINT);
  89. STDMETHODIMP Move(LPCRECT);
  90. STDMETHODIMP IsPageDirty(void);
  91. STDMETHODIMP Apply(void);
  92. STDMETHODIMP Help(LPCOLESTR);
  93. STDMETHODIMP TranslateAccelerator(LPMSG);
  94. STDMETHODIMP EditProperty(DISPID);
  95. };
  96. typedef CSysmonPropPage *PCSysmonPropPage;
  97. #endif //_SMONPROP_H_