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.

139 lines
4.1 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. ctrprop.h
  5. Abstract:
  6. Header file for the counter date property page
  7. --*/
  8. #ifndef _CTRPROP_H_
  9. #define _CTRPROP_H_
  10. #include "smonprop.h"
  11. #include "visuals.h"
  12. // Property Page Dialog IDs
  13. #define IDD_CTR_PROPP_DLG 200
  14. #define IDC_CTRLIST 201
  15. #define IDC_ADDCTR 202
  16. #define IDC_DELCTR 203
  17. #define IDC_ADDCTR_TEXT 204
  18. #define IDC_LINECOLOR 205
  19. #define IDC_LINESCALE 206
  20. #define IDC_LINEWIDTH 207
  21. #define IDC_LINESTYLE 208
  22. #define IDC_LABEL_LINECOLOR 209
  23. #define IDC_LABEL_LINESCALE 210
  24. #define IDC_LABEL_LINEWIDTH 211
  25. #define IDC_LABEL_LINESTYLE 212
  26. typedef struct _ItemProps
  27. {
  28. // Combo box indices
  29. INT iColorIndex;
  30. INT iStyleIndex;
  31. INT iScaleIndex;
  32. INT iWidthIndex;
  33. // Custom color
  34. COLORREF rgbColor;
  35. } ItemProps;
  36. typedef struct _ItemInfo
  37. {
  38. struct _ItemInfo * pNextInfo;
  39. ICounterItem * pItem;
  40. LPTSTR pszPath;
  41. BOOL fLoaded:1,
  42. fChanged:1,
  43. fAdded:1;
  44. ItemProps Props;
  45. PPDH_COUNTER_PATH_ELEMENTS pCounter;
  46. } ItemInfo, *PItemInfo;
  47. class CCounterPropPage : public CSysmonPropPage
  48. {
  49. friend static HRESULT AddCallback (
  50. LPTSTR pszPathName,
  51. DWORD_PTR lpUserData,
  52. DWORD dwFlags
  53. );
  54. public:
  55. CCounterPropPage(void);
  56. virtual ~CCounterPropPage(void);
  57. protected:
  58. virtual BOOL GetProperties(void); //Read current options
  59. virtual BOOL SetProperties(void); //Set new options
  60. virtual void DeinitControls(void); // Deinitialize dialog controls
  61. virtual void DialogItemChange(WORD wId, WORD wMsg); // Handle item change
  62. virtual void MeasureItem(PMEASUREITEMSTRUCT); // Handle user measure req
  63. virtual void DrawItem(PDRAWITEMSTRUCT); // Handle user draw req
  64. virtual HRESULT EditPropertyImpl( DISPID dispID); // Set focus to control
  65. private:
  66. void DeleteInfo(PItemInfo pInfo);
  67. void SetStyleComboEnable(); // Enable/disable based on current width value
  68. void InitDialog(void);
  69. void AddCounters(void);
  70. HRESULT NewItem(LPTSTR pszPath, DWORD dwFlags);
  71. INT AddItemToList(PItemInfo pInfo);
  72. void DeleteItem();
  73. void LoadItemProps(PItemInfo pInfo);
  74. void DisplayItemProps(PItemInfo pInfo);
  75. void SelectItem(INT iItem);
  76. INT SelectMatchingItem(INT iColor, COLORREF rgbCustomColor, INT iWidth, INT iStyle);
  77. INT ScaleFactorToIndex ( INT iScaleFactor );
  78. INT IndexToScaleFactor ( INT iScaleIndex );
  79. void IncrementLocalVisuals ( void );
  80. void SetModifiedSelectedVisuals ( BOOL bModified = TRUE ) { m_bAreModSelectedVisuals = bModified; };
  81. BOOL AreModifiedSelectedVisuals ( void ){ return m_bAreModSelectedVisuals; };
  82. private:
  83. PItemInfo m_pInfoSel;
  84. PItemInfo m_pInfoDeleted;
  85. ItemProps m_props;
  86. INT m_iAddIndex;
  87. DWORD m_dwMaxHorizListExtent;
  88. BOOL m_bAreModSelectedVisuals;
  89. PDH_BROWSE_DLG_CONFIG m_BrowseInfo;
  90. enum eValueRange {
  91. eHashTableSize = 257
  92. };
  93. typedef struct _HASH_ENTRY {
  94. struct _HASH_ENTRY* pNext;
  95. PPDH_COUNTER_PATH_ELEMENTS pCounter;
  96. } HASH_ENTRY, *PHASH_ENTRY;
  97. PHASH_ENTRY m_HashTable[257];
  98. BOOL m_fHashTableSetup;
  99. ULONG HashCounter ( LPTSTR szCounterName );
  100. public:
  101. BOOL RemoveCounterFromHashTable( LPTSTR pszPath, PPDH_COUNTER_PATH_ELEMENTS pCounter);
  102. void InitializeHashTable( void );
  103. void ClearCountersHashTable ( void );
  104. DWORD InsertCounterToHashTable ( LPTSTR pszPath, PPDH_COUNTER_PATH_ELEMENTS* ppCounter );
  105. };
  106. typedef CCounterPropPage *PCCounterPropPage;
  107. DEFINE_GUID(CLSID_CounterPropPage,
  108. 0xcf948561, 0xede8, 0x11ce, 0x94, 0x1e, 0x0, 0x80, 0x29, 0x0, 0x43, 0x47);
  109. #endif //_CTRPROP_H_