How to implemented CPU utilization using c++ which matches task manager.
We are developing an application which can run on different windows OS version from from windows 7 to windows 11. We want to develop CPU utilization which should be in sync with the task manager.
Can someone suggest the way to implement this feature which works on all the versions of windows till date and further. I see there are changes in the implementation for CPU utilization in task manager from versions as per below sources.
https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/cpu-usage-exceeds-100
So, I would be great if someone can guide me the correct implementation by which my software output is matching with all versions of windows OS.