Results 1 to 22 of 22

Thread: [RESOLVED] Detecting Sleep / Standby mode

Threaded View

  1. #19
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,670

    Re: Detecting Sleep / Standby mode

    ...come on, you can google a single missing constant and enum... sorry I only did 99% of the work for you.

    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
    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.

    The IsPwrHibernateAllowed function like the others also only indicates whether it's supported, not whether it'd enabled.
    Last edited by fafalone; Mar 8th, 2024 at 07:55 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width