Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ code for CPU load and CPU temperature

Tags:

c++

cpu

load

I want to see CPU temperature and CPU load in Windows. I have to write it myself not using software like Core Temp. How can I access this information?

I read a similar question to mine, but there was no useful answer:(.

like image 776
Sara Avatar asked Nov 07 '11 04:11

Sara


2 Answers

Take a look at Getting CPU temp from MSDN forums, there are a few approaches.

As to the sane way, you can use Win32_TemperatureProbe class, that gets its intel from SMBIOS.

like image 24
tolitius Avatar answered Sep 30 '22 20:09

tolitius


Recently I have started a similar project. I needed to read the cpu temperature and to control the fan in Linux and Windows. I don't know much about C++ and VS and DDK but I figured how to write a simple kernel driver and a simple program with winring0. In my laptop (and most other) the temperature and the fan is controled by the embedded controller. You have 2 choices, either you can write a kernel driver or you can use a library to access the embedded controller. It's because Windows protect the ec from being accessed with normal user rights. A good (and working) library is winring0 (WinRing0_1_3_1b). A useful program to check the ec and everything else in Windows is the RW tool.

like image 88
Micromega Avatar answered Sep 30 '22 21:09

Micromega