-2

How can I calculate device bandwidth usage percentage using windows API

I tried using GetIpStatisticsEx() function but that didn't help

Ahmad
  • 11
  • 3
  • Overall bandwidth or for a single process or connection? – user4581301 Jan 10 '23 at 06:09
  • Have you tried perfmon yet (performance monitor app that comes with windows)? It should be able to show you some statistics regarding network traffic (per process). Once you know which counters you want , you can also access them from C++: [Accessing Performance Data in C++](https://learn.microsoft.com/en-us/windows/win32/wmisdk/accessing-performance-data-in-c--?redirectedfrom=MSDN) – Pepijn Kramer Jan 10 '23 at 06:23
  • ×Overall bandwidth @user4581301 – Ahmad Jan 10 '23 at 08:01
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jan 10 '23 at 20:45

1 Answers1

2

You could try to use GetIfTable function

GetIfTable function enumerates physical interfaces on a local system and returns this information in a MIB_IFTABLE structure. The MIB_IFTABLE structure contains an interface count and an array of MIB_IFROW structures for each interface.

Jeaninez - MSFT
  • 3,210
  • 1
  • 5
  • 20