How to get CPU usage or disk usage using Windows API with C ++?

How to switch to processor usage or disk usage by application using API in C ++ ???

I want to get the most CPU usage or disk usage among applications running on Windows. I tried to find the API, but there is no direct API for this. Can someone please let me know how to do this in C ++.

+4
source share
2 answers

You look at performance counters in the process category to get each CPU / Memory / IO processor or in the corresponding categories (processor, memory, physical / logical disk) for overall system performance. Values ​​can be accessed through dedicated APIs or WMIs .

+1
source

Windows 7 already has this built-in component as part of the Resource Monitor (realmon.exe). If you want to find this in code, you can use the Perf counter API or create an ETW real-time consumer against the NT kernel provider.

+1
source

All Articles