I want to get the battery temperature in Windows, and I have tried DeviceIoControl function (http://msdn.microsoft.com/en-us/library/aa372698(v=vs.85).aspx) on the BatteryTemperature.
I have tried other parameter like BatterySerialNumber, and it returns the serial number, but while I want to get the temperature, the function returns FALSE. And GetLastError returns S_FALSE.
My enviroment is Win7 Enterprise SP1, I developed on VS2008+SP1, total C++ code, my laptop is HP Elitebook 2570p. Can anyone give some suggestions on this topic. I have searched Google and donot find any help topic, or should I write some driver code to get the temperature? Or this laptop battery doesnot support this function?
Thanks very much.
PS. If there are any other tech which can get the temperature is welcome, not only in C++.
S_FALSE returned by GetLastError is also just 1, which is also ERROR_INVALID_FUNCTION. Extract from MSDN:
If the particular type of data requested is not available for the current battery, then ERROR_INVALID_FUNCTION is returned.
This means your battery has no temperature sensor or manufacturer who written the battery driver decided not to provide this information to Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With