IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Refuse to Sleep/Hibernate if recording feature, Has it gone missing?
mikebliv
post May 11 2010, 03:33 AM
Post #1


Participant


Group: New Members
Posts: 13
Joined: 11-March 10
Member No.: 13,244
Card: DVICO FusionHDTV DVB-T USB


I'm quite sure this feature was there before but the latest version allows me to sleep/hibernate the machine (Windows 7) while in the middle of recording. The feature still works for shutdown.

Any idea what happened to it?
Go to the top of the page
 
+Quote Post
null_pointer
post May 11 2010, 07:13 PM
Post #2


Web Scheduler Developer


Group: Developers
Posts: 4,495
Joined: 9-July 03
From: Melb
Member No.: 9
Card: None


windows 7 happened :-)
Go to the top of the page
 
+Quote Post
mikebliv
post May 12 2010, 04:48 AM
Post #3


Participant


Group: New Members
Posts: 13
Joined: 11-March 10
Member No.: 13,244
Card: DVICO FusionHDTV DVB-T USB


So is this feature something that can be reinstated for Windows 7?

If not, is there something I can run in a batch file that will detect that a recording is happening and abort the sleep/hibernate?

My quick and dirty solution would be to check for the non-existence of the temporary file while recording, before running "shutdown /h".

Hopefully there's a more elegant solution?
Go to the top of the page
 
+Quote Post
bear
post May 12 2010, 06:55 PM
Post #4


Forum Regular


Group: Members
Posts: 3,023
Joined: 24-April 04
From: Queensland
Member No.: 808
Card: VisionPlus DVB-t


Guys,

To further clarify with quotes from msdn http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx
QUOTE
The ES_AWAYMODE_REQUIRED value should be used only when absolutely necessary by media applications that require the system to perform background tasks such as recording television content or streaming media to other devices while the system appears to be sleeping.


QUOTE
To enable away mode, an application uses both ES_AWAYMODE_REQUIRED and ES_CONTINUOUS; to disable away mode, an application calls SetThreadExecutionState with ES_CONTINUOUS and clears ES_AWAYMODE_REQUIRED. When away mode is enabled, any operation that would put the computer to sleep puts it in away mode instead. The computer appears to be sleeping while the system continues to perform tasks that do not require user input. Away mode does not affect the sleep idle timer; to prevent the system from entering sleep when the timer expires, an application must also set the ES_SYSTEM_REQUIRED value.


Example:
CODE
// Television recording is beginning. Enable away mode and prevent
// the sleep idle time-out.
//
SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED);

//
// Wait until recording is complete...
//

//
// Clear EXECUTION_STATE flags to disable away mode and allow the system to idle to sleep normally.
//
SetThreadExecutionState(ES_CONTINUOUS);


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

Says it all.
Go to the top of the page
 
+Quote Post
null_pointer
post May 12 2010, 07:36 PM
Post #5


Web Scheduler Developer


Group: Developers
Posts: 4,495
Joined: 9-July 03
From: Melb
Member No.: 9
Card: None


yep, I have done all I can I think to stop the system form going into sleep or hibernate but win 7 give the user the final say.
Go to the top of the page
 
+Quote Post
mikebliv
post May 12 2010, 09:16 PM
Post #6


Participant


Group: New Members
Posts: 13
Joined: 11-March 10
Member No.: 13,244
Card: DVICO FusionHDTV DVB-T USB


Thanks guys. I'll have to try my quick and dirty batch file solution.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd May 2013 - 11:21 AM