Prevent Windows From Entering Hibernate Mode in WINDOWS 7

Dec 15, 2011 at 7:24am
Hello,

I have to prevent Windows 7 from entering Hibernate mode.



Preventing it to enter SLEEP mode was done by

"SetThreadExecutionState(ES_CONTINUOUS |ES_AWAYMODE_REQUIRED|ES_SYSTEM_REQUIRED|ES_DISPLAY_REQUIRED);"


but this code doesn't stop windows from entering Hibernation.

what can be done to achieve the above..??
Dec 15, 2011 at 2:09pm
If the user requests the PC to sleep or hibernate, you just cannot stop it, which I guess is what you're saying because that works for me just fine when the user doesn't request the low power action.
Dec 15, 2011 at 10:21pm
Hibernation is not enabled by default in windows 7, but I guess you could disable hibernation by messing with power plans if your app is running elevated.
Topic archived. No new replies allowed.