public static uint GetMainBatteryChargePercent()
        {
            FMSC.Controls.Win32.SYSTEM_POWER_STATUS_EX status = new FMSC.Controls.Win32.SYSTEM_POWER_STATUS_EX();

            if (FMSC.Controls.Win32.GetSystemPowerStatusEx(status, false) == 1)
            {
                return status.BatteryLifePercent;
            }

            return 0;
        }
        public static uint GetBackupBatteryChargePercent()
        {
            FMSC.Controls.Win32.SYSTEM_POWER_STATUS_EX status = new FMSC.Controls.Win32.SYSTEM_POWER_STATUS_EX();

            if (FMSC.Controls.Win32.GetSystemPowerStatusEx(status, false) == 1)
            {
                return status.BackupBatteryLifePercent; // careful. returns 255 if no backup battery
            }

            return 0;
        }