ken82m Posted November 28, 2008 Share Posted November 28, 2008 (edited) 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 December 1, 2008 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 More sharing options...
99ojo Posted November 28, 2008 Share Posted November 28, 2008 Does anyone know how to check to see if standby and hibernateare 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,Kennyyou 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 More sharing options...
November Posted November 28, 2008 Share Posted November 28, 2008 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 More sharing options...
Moderators SmOke_N Posted November 28, 2008 Moderators Share Posted November 28, 2008 (edited) http://msdn.microsoft.com/en-us/library/aa373163(VS.85).aspxEdit: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] EndFuncShould 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).aspxUnfortunately, that just doesn't interest me lol... Edited November 28, 2008 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 More sharing options...
November Posted November 28, 2008 Share Posted November 28, 2008 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).aspxUnfortunately, that just doesn't interest me lol...LOOOOLLOOOOLI 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 More sharing options...
ken82m Posted December 1, 2008 Author Share Posted December 1, 2008 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 More sharing options...
ken82m Posted December 1, 2008 Author Share Posted December 1, 2008 (edited) 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 December 1, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now