Jump to content

Is Standby/Hibernation Enabled? [SOLVED]


ken82m
 Share

Recommended Posts

Does anyone know how to check to see if standby and hibernate

are enabled on a machine?

I'm writing a custom shutdown application and I'd like to be able

to gray them out if they are not enabled.

Thanks,

Kenny

Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Does anyone know how to check to see if standby and hibernate

are enabled on a machine?

I'm writing a custom shutdown application and I'd like to be able

to gray them out if they are not enabled.

Thanks,

Kenny

you may use cmdline: powercfg /q. i don't know exactly, if you need adminsitrative rights for the command. if you use cmdline, you have to check and you may have to use autoit command RunAs.

;-))

Stefan

Link to comment
Share on other sites

Hi there,

Does THIS help?

It's for W2K but the key also exists in WVISTA.

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

  • Moderators

http://msdn.microsoft.com/en-us/library/aa373163(VS.85).aspx

Edit:

Func _IsPwrHibernateAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrHibernateAllowed")
    Return $a_ret[0]
EndFunc

Func _IsPwrShutdownAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrShutdownAllowed")
    Return $a_ret[0]
EndFunc

Func _IsPwrSuspendAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrSuspendAllowed")
    Return $a_ret[0]    
EndFunc

Should probably figure out this huge ass struct: http://msdn.microsoft.com/en-us/library/aa373215(VS.85).aspx and use this function instead though: http://msdn.microsoft.com/en-us/library/aa372691(VS.85).aspx

Unfortunately, that just doesn't interest me lol...

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Should probably figure out this huge ass struct: http://msdn.microsoft.com/en-us/library/aa373215(VS.85).aspx and use this function instead though: http://msdn.microsoft.com/en-us/library/aa372691(VS.85).aspx

Unfortunately, that just doesn't interest me lol...

LOOOOLLOOOOL

I wonder why... :)

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

Damn I'm sorry I thought I had a subscription on this, I'm going through everything now lol :)

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Wow! Amazing what you can come up with when you know what your doing, unlike me lol :)

I'm gonna save your post and that page to a PDF I've always been looking for an easy way to interact with the power settings besides powercfg.exe.

Thanks alot!

Kenny

http://msdn.microsoft.com/en-us/library/aa373163(VS.85).aspx

Edit:

Func _IsPwrHibernateAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrHibernateAllowed")
    Return $a_ret[0]
EndFunc

Func _IsPwrShutdownAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrShutdownAllowed")
    Return $a_ret[0]
EndFunc

Func _IsPwrSuspendAllowed()
    Local $a_ret = DllCall("PowrProf.dll", "int", "IsPwrSuspendAllowed")
    Return $a_ret[0]    
EndFunc

Should probably figure out this huge ass struct: http://msdn.microsoft.com/en-us/library/aa373215(VS.85).aspx and use this function instead though: http://msdn.microsoft.com/en-us/library/aa372691(VS.85).aspx

Unfortunately, that just doesn't interest me lol...

Edited by ken82m

 "I believe that when we leave a place, part of it goes with us and part of us remains... Go anywhere, when it is quiet, and just listen.. After a while, you will hear the echoes of all our conversations, every thought and word we've exchanged.... Long after we are gone our voices will linger in these walls for as long as this place remains."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...