TrafficMonitor

repository·master·Indexed 13 days ago

https://github.com/zhongyang219/trafficmonitor

A Windows utility for real-time monitoring of network traffic, CPU, and memory usage via a floating window or taskbar integration. It features a plugin system for extended functionality, custom skin support, and hardware monitoring via the LibreHardwareMonitor library.

Tokens
10.3K
Snippets
12
Records
64
Agent score
98%

What's inside TrafficMonitor

  1. Project Structure Overview for TrafficMonitor

    master

    TrafficMonitor is a Visual C++ project built using the Microsoft Foundation Class (MFC) library. It is structured as a dialog-based application. Understanding the file roles helps in customizing the application or building new features on top of the existing scaffold.

    Core Application Files

    • TrafficMonitor.vcxproj: The main VC++ project file containing build configurations, platform settings, and project features.
    • TrafficMonitor.h: The primary header file. It includes project-specific headers (like Resource.h) and declares the CTrafficMonitorApp application class.
    • TrafficMonitor.cpp: The main source file containing the implementation of the CTrafficMonitorApp class.

    UI and Dialog Management

    • TrafficMonitorDlg.h & TrafficMonitorDlg.cpp: These files define the CTrafficMonitorDlg class, which controls the behavior of the application's main dialog.
    • TrafficMonitor.rc: The resource script containing all Windows resources (icons, bitmaps, cursors). The dialog template is defined here.
    • res\TrafficMonitor.ico: The application icon file.
    • res\TrafficMonitor.rc2: Contains resources that cannot be edited directly via the Microsoft Visual C++ resource editor.

    Supporting Files

    • Resource.h: Standard header used to define new resource IDs.
    • StdAfx.h & StdAfx.cpp: Used to generate Precompiled Header (PCH) files (TrafficMonitor.pch) to speed up compilation.
    • TrafficMonitor.manifest: Describes application dependencies on specific versions of parallel assemblies for Windows compatibility.
  2. Use the Plugin System to extend TrafficMonitor

    master

    TrafficMonitor features a plugin system that allows users to display custom content in both the taskbar window and the main window.

    Key capabilities introduced in recent versions include:

    • Custom Content: Display additional metrics via plugins.
    • Resource Usage Graphs: Plugins can now display resource usage graphs directly in taskbar items (introduced in V1.85).
    • Plugin Management: Users can manage plugins through a dedicated interface which includes plugin icons and right-click commands.
    • Keyboard Interaction: The plugin interface has been updated to allow plugins to respond to keyboard events.
  3. Choose between Standard and Lite versions

    master

    TrafficMonitor provides two versions depending on your monitoring needs and permission levels:

    • Standard Version: Includes all features, including hardware monitoring (temperature, GPU, hard disk usage). Requires administrator privileges to run.
    • Lite Version: Does not include temperature monitoring. Since version 1.86, it does include GPU and hard disk usage monitoring. It does not require administrator privileges.

    Note on Temperature Monitoring: In newer versions, the temperature monitoring function is being moved out of the main application. If you need temperature monitoring, it is recommended to use the Hardware Monitor plugin instead of the standard version. The standard version will eventually be deprecated in favor of the Lite version + plugins.

  4. Important notes on Hardware Monitoring

    master

    TrafficMonitor uses the LibreHardwareMonitor library for hardware monitoring (temperature, GPU usage, CPU frequency).

    Risks and Usage

    • Performance Impact: Enabling hardware monitoring may increase CPU and memory consumption.
    • Stability Warning: Some users have reported system crashes or freezes when temperature monitoring is enabled. Use this feature at your own risk.
    • Default State: Hardware monitoring is disabled by default. You must manually enable it in "选项设置" (Options) $\rightarrow$ "常规设置" (General Settings) $\rightarrow$ "硬件监控" (Hardware Monitoring).
    • Recommendation: If you experience stability issues, use the Lite version or use the standalone Hardware Monitor Plugin instead.
  5. Configure Hardware Monitoring (CPU, GPU, Disk, Motherboard)

    master

    TrafficMonitor provides extensive hardware monitoring capabilities.

    Supported Metrics:

    • CPU: Utilization, frequency, and temperature (supports selecting specific cores).
    • GPU: Utilization and temperature (includes support for Intel graphics).
    • Disk: Utilization and temperature (supports selecting specific disks).
    • Motherboard: Temperature monitoring.
    • Memory: Utilization and remaining memory display.

    Configuration Notes:

    • Monitoring Interval: Users can set the monitoring time interval (maximum value is 30s as of V1.85).
    • Temperature Notifications: The default upper limit for temperature notifications is 120°C.
    • Hardware Library: The application uses LibreHardwareMonitor for hardware data acquisition.
  6. Use custom skins and layout settings

    master

    TrafficMonitor supports custom skins to define the appearance and layout of the floating window.

    • Skin Customization: Skin files can define the size and position of individual items within the floating window.
    • Skin Features: Some skins support irregular shapes and allow defining alignment and font styles directly through the skin file.
    • Previewing: The 'Change Skin' (更换皮肤) dialog provides previews of text and fonts used in the skin.
  7. Use the Plug-in system

    master

    TrafficMonitor supports a plug-in system (v1.82+) to extend functionality.

    • Installation: Place plug-in .dll files into the plugins directory (located at the same level as TrafficMonitor.exe). Plugins load automatically on startup.
    • Management: Use the menu More Functions -> Plugin Management to view and manage loaded plugins.
    • Hardware Monitor Plugin: If you require temperature monitoring in the Lite version, you must download and install the Hardware Monitor plugin.
  8. Use the plugin system

    master

    TrafficMonitor supports external plugins via DLL files.

    Installing Plugins

    1. Download a plugin (e.g., from the TrafficMonitor Plugins repository).
    2. Place the plugin .dll file in the plugins directory located in the same folder as TrafficMonitor.exe.
    3. The program will automatically load the plugin upon startup.

    Managing Plugins

    Right-click the window $\rightarrow$ "更多功能" (More Functions) $\rightarrow$ "插件管理" (Plugin Management) to view or manage loaded plugins.

    For developers, refer to the Plugin Development Guide.

  9. Fix 'Unable to save settings' error

    master

    This error occurs when the program lacks write permissions to its directory.

    Option 1: Move the program

    Move TrafficMonitor to a folder where your user has write permissions.

    1. Exit TrafficMonitor and restart it as Administrator.
    2. Right-click $\rightarrow$ 选项 (Options) $\rightarrow$ 常规设置 (General Settings) $\rightarrow$ 数据和配置文件 (Data and Config Files).
    3. Select 保存到Appdata目录 (Save to Appdata directory).

    Option 3: Manual configuration fix

    If you cannot save via the UI, manually create or edit global_cfg.ini in the program directory with the following content:

    [config]
    portable_mode = false

    Note: In versions 1.79+, if the program directory is unwritable, it automatically defaults to saving in %AppData%\TrafficMonitor.

  10. Install and set up TrafficMonitor

    master

    TrafficMonitor is a Windows-based network speed monitor that displays real-time network throughput, CPU, and memory usage. It can be displayed as a floating window or embedded into the taskbar.

    Installation Steps

    1. Download: Get the latest version from the GitHub Releases page.
    2. Prerequisites: Ensure you have the Microsoft Visual C++ Redistributable installed. If you see errors like MSVC*.dll not found, download it from the official Microsoft Docs.
    3. Version Selection:
      • Standard Version: Includes full hardware monitoring (temperature, GPU, disk usage). Requires Administrator privileges.
      • Lite Version: Does not include temperature monitoring. Does not require Administrator privileges.
      • Note: As of version 1.86, the Lite version includes GPU and disk usage monitoring but excludes temperature monitoring. Temperature monitoring has been moved to a separate Hardware Monitor Plugin.
  11. Contact the author for support

    master

    If you encounter issues that cannot be resolved by the steps above, you can contact the author via the "Contact Author" button in the About dialog box or by email at zhongyang219@hotmail.com.

    When reporting an issue, please include:

    • A detailed description of the problem.
    • The exact error prompts received.
    • The operations you attempted before the error occurred.
    • Screenshots of the issue.
    • The configuration file (Access it via Options -> General Settings -> Open configuration file path).

    Important Note on Email: Ensure you provide a valid, reachable email address. If your Windows Microsoft account uses a third-party email that appears as Outlook_<random_string>@outlook.com, explicitly include your actual primary email address in the message, as the automated one may not be able to receive replies.

  12. Set individual colors for taskbar items

    master

    To assign different colors to each item in the taskbar window instead of a single uniform color:

    1. Right-click and select 选项 (Options).
    2. Switch to the 任务栏窗口设置 (Taskbar Window Settings) tab.
    3. Check 指定每个项目的颜色 (Specify color for each item).
    4. Click the color block next to 文本颜色 (Text Color) to open the 任务栏窗口颜色设置 (Taskbar Window Color Settings) dialog.