|
关于获得PDA的电量问题,为什么得不到电量的值??
[复制链接]
typedef (WINAPI* GETSYSTEMPOWERSTATUSEX)(SYSTEM_POWER_STATUS_EX *,BOOL);
GETSYSTEMPOWERSTATUSEX vGetSystemPowerStatuEx;
SYSTEM_POWER_STATUS_EX stat;
HMODULE m_hmCore = LoadLibrary(_T("coredll.dll"));
if(m_hmCore != NULL)
{
vGetSystemPowerStatuEx = (GETSYSTEMPOWERSTATUSEX) GetProcAddress (m_hmCore,_T("GetSystemPowerStatusEx"));
}
vGetSystemPowerStatuEx(&stat,true);
int x = stat.BatteryLifePercent;
我用上面的方法来获得PDA的电量,但在实际的机器上运行时 x的值一直是 0
请问下各位大虾,问题出在什么地方??
|
|