Prevent Windows From Entering Hibernate Mode in WINDOWS 7

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