...come on, you can google a single missing constant and enum... sorry I only did 99% of the work for you.
Anyway, the code I posted tells you if it's enabled or not-- the 'Put the computer to sleep after' option or under advanced options, it covers both 'Sleep after' and 'Hibernate after', and yes you know by the fact you're running you're not in sleep mode.Code:Public Const NUM_DISCHARGE_POLICIES = 4 Public Type SYSTEM_POWER_LEVEL Enable As Byte Spare(0 To 2) As Byte BatteryLevel As Long PowerPolicy As POWER_ACTION_POLICY MinSystemState As SYSTEM_POWER_STATE End Type
The IsPwrHibernateAllowed function like the others also only indicates whether it's supported, not whether it'd enabled.




Reply With Quote
