mftrafficbutton.h
上传用户:fangbo2004
上传日期:2022-05-14
资源大小:2257k
文件大小:3k
源码类别:

网络截获/分析

开发平台:

Visual C++

  1. #if !defined(AFX_MFTRAFFICBUTTON_H__9F2EABAA_E8C7_48B4_94A5_EC279905F50C__INCLUDED_)
  2. #define AFX_MFTRAFFICBUTTON_H__9F2EABAA_E8C7_48B4_94A5_EC279905F50C__INCLUDED_
  3. #include "MFNetTraffic.h" // Added by ClassView
  4. #include "Globals.h"
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif // _MSC_VER > 1000
  8. /////////////////////////////////////////////////////////////////////////////
  9. // MFTrafficButton window
  10. //VOID CALLBACK InterfaceChanged(int newInterface);
  11. //typedef FARPROC INTERFACECHANCEDPROC;
  12. typedef VOID (CALLBACK* INTERFACECHANCEDPROC)(int);
  13. class MFTrafficButton : public CButton
  14. {
  15. public:
  16. MFTrafficButton();
  17. // Attributes
  18. public:
  19. // Operations
  20. public:
  21. // Overrides
  22. // ClassWizard generated virtual function overrides
  23. //{{AFX_VIRTUAL(MFTrafficButton)
  24. public:
  25. virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  26. protected:
  27. virtual void PreSubclassWindow();
  28. //}}AFX_VIRTUAL
  29. // Implementation
  30. public:
  31. void SetAdaptiveScaling(BOOL adaptive);
  32. void SetInterfaceNumber(int interfacenumber);
  33. enum traffictype
  34. {
  35. Traffic_Total = 0,
  36. Traffic_Incoming = 1,
  37. Traffic_Outgoing = 2
  38. };
  39. void SelectTrafficType(int trafficType);
  40. void SetInterfaceNumberNotificationFunction(INTERFACECHANCEDPROC callfunct);
  41. void SetUpdateSpeed(UINT netspeed, UINT gridspeed);
  42. void ReInit(int newInterface);
  43. void ReInit(RECT newSize);
  44. virtual ~MFTrafficButton();
  45. // Generated message map functions
  46. protected:
  47. //{{AFX_MSG(MFTrafficButton)
  48. afx_msg void OnTimer(UINT nIDEvent);
  49. afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  50. //}}AFX_MSG
  51. DECLARE_MESSAGE_MAP()
  52. private:
  53. void InterfaceHasChanged();
  54. INTERFACECHANCEDPROC interfaceCallBack;
  55. MFNetTraffic m_cTrafficClass;
  56. CFont smallFont;
  57. CBrush colorbrush;
  58. COLORREF red, green, back, cyan, darkblue, darkgray, white, black, lightgreen, darkgreen;
  59. CBitmap colorbrushbmp;
  60. CPen GridPen;
  61. CSize TGSize;
  62. CBrush greenbrush;
  63. CBrush redbrush;
  64. CPoint orgBrushOrigin; 
  65. RECT TrafficDrawRectangle;
  66. RECT TrafficDrawUpdateRectangle;
  67. CString CurrentTraffic;
  68. CString MaximalTraffic;
  69. CString AllTraffic;
  70. DWORD TrafficEntries;
  71. BOOL initalized;
  72. BOOL isOnline;
  73. BOOL brushInitalized;
  74. CRgn ShapeWNDRegion;
  75. CRgn ShapeDCRegion;
  76. double MaxTrafficAmount;
  77. CString ToggleStatusText;
  78. int SelectedInterface;
  79. BOOL useAdaptiveScale;
  80. TRAFFICENTRY* TrafficStats;
  81. int gridxstartpos;
  82. int gridystartpos;
  83. int plotgranularity;
  84. public:
  85. int gridxresolution; // 网格大小
  86. int gridyresolution;
  87. int gridscrollxspeed; // 网格滚动速度
  88. int gridscrollyspeed; 
  89. int netupdatespeed; // 网络更新速度
  90. int gridupdatespeed;
  91. };
  92. /////////////////////////////////////////////////////////////////////////////
  93. //{{AFX_INSERT_LOCATION}}
  94. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  95. #endif // !defined(AFX_MFTRAFFICBUTTON_H__9F2EABAA_E8C7_48B4_94A5_EC279905F50C__INCLUDED_)