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.

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