ObjReader Community

Tips & Tricks => Tips & Tricks => Topic started by: Patrice Terrier on April 04, 2020, 04:39:40 pm

Title: CPU Meter
Post by: Patrice Terrier on April 04, 2020, 04:39:40 pm
CPU Meter widget

 (http://www.objreader.com/download/images/CPU_Meter.jpg)

Is available for:
Complete source code is provided in the attachment, you must be registered to see it and download the zip files.

The WD17+ version is available from the repository here. (https://repository.windev.com/resource.awp?file_id=281474976710913;cpu-meter)


Title: Re: CPU Meter
Post by: Patrice Terrier on July 08, 2024, 06:16:49 pm
This is version 2.00.

It has been reworked to match the CPU processor percentage computation used in Windows 11.

On previous Windows 10, they were using "Processor(_Total)\\% Processor Time"

The solution is to use PDH (Performance Data Helper) and the Processor Utility request
nStatus = PdhAddEnglishCounter(cpuQuery, L"\\Processor Information(_Total)\\% Processor Utility", NULL, &cpuTotal);

\\Processor Information(_Total)\\% Processor Utility
\\Processor(_Total)\\% Processor Time
Note:
The project use TCLib.lib to produce a tiny 29 Kb binary executable.