hirschy Posted June 4, 2007 Posted June 4, 2007 powercfg /h offhttp://technet2.microsoft.com/windowsserve...3.mspx?mfr=true
BradleyB Posted March 3, 2010 Posted March 3, 2010 I've been using the following code to prevent Windows XP systems from going into stand-by or even the screen-saver from kicking in - has really solved a problem for me. However, this doesn't seem to work on Vista or Win7 systems. Are there different locations that need to be referenced or is the the kernel21.dll no longer the one that controls this? I would appreciate any advice. Try this... AdlibEnable( "NoSleep", 50 * 1000 ); reset the standy-timer every 50 seconds Func NoSleep(); see the description of the SetThreadExecutionState function of kernel32.dll at http://msdn2.microsoft.com/en-us/library/aa373208.aspx Local Const $ES_DISPLAY_REQUIRED = 0x00000002; use this to zero the display's idle timer Local Const $ES_SYSTEM_REQUIRED = 0x00000001; use this to zero the system's idle timer Local Const $ES_CONTINUOUS = 0x80000000; add this to the other flag(s) to keep the display or system on until another call to SetThreadExecutionState with $ES_CONTINUOUS without the other flag(s) DllCall( "kernel32.dll", "int", "SetThreadExecutionState", "int", $ES_SYSTEM_REQUIRED ) EndFunc
Qwerty212 Posted September 4, 2010 Posted September 4, 2010 Any news of how to get it work on vista/win7?? Greets from Barcelona
Raik Posted December 2, 2010 Posted December 2, 2010 (edited) XP: http://msdn.microsoft.com/en-us/library/aa373208%28VS.85%29.aspx Vista: http://www.microsoft.com/whdc/system/pnppwr/powermgmt/AvailabilityRequests.mspx Edit: Edited December 2, 2010 by Raik AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1)
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