Private Declare Function SystemParametersInfo Lib "user32" Alias _ "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _ ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long Const SPI_GETLOWPOWERTIMEOUT = 79 Const SPI_GETPOWEROFFTIMEOUT = 80 Const SPI_GETLOWPOWERACTIVE = 83 Const SPI_GETPOWEROFFACTIVE = 84
Sub GetPowerInfo(PowerOffActive As Boolean, PowerOffTimeout As Long, _ LowPowerActive As Boolean, LowPowerTimeout As Long) Dim ok As Long SystemParametersInfo SPI_GETPOWEROFFACTIVE, 0, ok, 0 PowerOffActive = CBool(ok) SystemParametersInfo SPI_GETPOWEROFFTIMEOUT, 0, PowerOffTimeout, 0 SystemParametersInfo SPI_GETLOWPOWERACTIVE, 0, ok, 0 LowPowerActive = CBool(ok) SystemParametersInfo SPI_GETLOWPOWERTIMEOUT, 0, LowPowerTimeout, 0 End Sub |