CPU meter (widget)
Dans Windows 11, Le gestionnaire de tâches affiche un pourcentage d'utilisation CPU différent de celui affiché dans les versions précédentes.
La vieille méthode de calcul était basées sur GetSystemTimes, désormais Windows 11 s'appuie sur l'API "Performance Data Helper".
Afin que le résultat de la requête s'affiche correctement sur tous les ordinateurs indépendamment de la langue utilisée,
il est indispensable d'utiliser
nStatus = PdhAddEnglishCounter(cpuQuery, L"\\Processor Information(_Total)\\% Processor Utility", NULL, &cpuTotal);
\\Processor Information(_Total)\\% Processor Utility
\\Processor(_Total)\\% Processor Time
- Description: This counter measures the percentage of processor utility across all processors.
- Utility: It provides a more detailed and modern view of processor usage, taking into account various factors like the efficiency of processing and modern CPU architectures.
- Availability: This counter is generally available on newer systems with modern processors. It can give a more accurate representation of CPU utilization in multi-core and hyper-threaded environments.
- Description: This counter measures the percentage of time the processor is busy executing a non-idle thread.
- Utility: It is a more traditional counter that has been available in Windows for a long time. It reflects the CPU load by measuring the active time versus the idle time of the CPU.
- Availability: This counter is widely available across different versions of Windows and provides a consistent measure of CPU usage.
Note :
Le projet utilise TClib.lib pour produire un exécutable binaire de seulement 29 Ko (dont 14 Ko rien que pour l'icône).
L'interface du widget est réalisée avec GDImage64 et WinLIFT64.
Partager