Page 1 of 1

Prevent PC from sleeping

Posted: Fri Oct 18, 2013 4:39 pm
by archbish99
Just switching from ShowAnalyzer to ComSkip, and I notice that ComSkip doesn't appear to block sleep on the HTPC while it's analyzing. Have you considered simply calling SetThreadExecutionState ( ... s.85).aspx) to inform Windows you'd like the system to remain up? System would be a good choice; away mode is a bit debateable....

Of course, it appears to be enough faster than ShowAnalyzer that this may turn out not to be an issue. If it's set up to start detection while the show is recording, and then can continue detection while I'm watching it (and keep ahead of me) that's not necessarily a problem.

Re: Prevent PC from sleeping

Posted: Sat Oct 19, 2013 1:37 pm
by erik
Good proposal

Will try to add to next build

Re: Prevent PC from sleeping

Posted: Tue Nov 19, 2013 4:24 pm
by Jagad
Harder than it sounds to accomplish! At least for those using Win Vista/7/8. For XP users sleep/hibernation can be blocked.
For others if the winAPI have received a sleep/hibernation command no application can block it from be carried through.

The link even says so:
The SetThreadExecutionState function cannot be used to prevent the user from putting the computer to sleep. Applications should respect that the user expects a certain behavior when they close the lid on their laptop or press the power button.