[Share]Get Battery Life
Hello..
I thought i would release the functions i made for my menu in the D3D menu competition. so heres one..
Call in any drawing function..

I thought i would release the functions i made for my menu in the D3D menu competition. so heres one..
Code:
void Drawbatterylife( int x, int y )
{
SYSTEM_POWER_STATUS status;
GetSystemPowerStatus( &status );
int life = status.BatteryLifePercent;
char szLife[256];
sprintf(szLife,"%i",life);
DrawString(x, y, White, m_font, szLife);
switch (status.BatteryFlag)
{
case 1:
DrawString( x, y + 17, White, m_font, "High");
break;
case 2:
DrawString( x, y + 17, White, m_font, "Low");
break;
case 4:
DrawString( x, y + 17, White, m_font, "Criticial");
break;
case 128:
DrawString( x, y + 17, White, m_font, "No system battery");
break;
case 256:
DrawString( x, y + 17, White, m_font, "Unknown status");
break;
}
}

should display "No system battery" im thinkin..

