Hi,
I try to get the values BatteryVoltage and BatteryCurrent but it always
returns 0. Here is my code, did I miss something?
SYSTEM_POWER_STATUS_EX2 pwrstat;
memset(&pwrstat,0,sizeof(SYSTEM_POWER_STATUS_EX2));
if
(!GetSystemPowerStatusEx2(&pwrstat,sizeof(SYSTEM_POWER_STATUS_EX2),TRUE))
{
CTools::ViewLastError();
}
else
{
// extract the power status information
CString out= _T(" --- BATTERY ---\r\n");
CString temp;
temp.Format(_T("\tPercent:\t%d\r\n\tVoltage:\t%dmV\r\n\tDrain:\t%d"),pwrstat.BatteryLifePercent
,pwrstat.BatteryVoltage, pwrstat.BatteryCurrent);
out += temp;
OutputEditBox(out);
}
Thanks,
Marco