Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Windows 7 can turn go to sleep when I close my lid, or after a period of inactivity. Fine.

I don't want it to go to sleep immediately after closing the lid; I want it to wait 5 minutes and then go to sleep.

Can this be done?

share|improve this question
    
this stackoverflow.com/questions/3355606/… was about the needed API for creating such program. Still trying to decipher what it means. I suppose I can make a tiny C# apps to deal with it –  Martheen Cahya Paulo Aug 8 '11 at 4:45
    
Why do you want to do this? –  soandos Aug 8 '11 at 4:49
2  
@soandos I close up my laptop around 5pm all the time, only to have the phone ring as I'm still packing it up with some final thing someone wants to check. –  Joel Coehoorn Aug 8 '11 at 5:25

1 Answer 1

This capability isn't built into windows 7, and I'm not aware of software that will do this (thought that certainly doesn't mean no such software exists). If you have any programming ability (and your profile indicates you're no slouch here), this stackoverflow question will get you started building your own:

http://stackoverflow.com/questions/3355606/detect-laptop-lid-closure-and-opening

In a nutshell: set the default action in Windows 7 to not do anything, but have your program running as a service and handle the WM_POWERBROADCAST message. When you spot one with the right data, set a timer for 5 minutes and put the machine to sleep when it goes off. Different data on that message or messages that indicate user activity (like WM_MOUSEMOVE or WM_KEYDOWN) might cancel the timer.

share|improve this answer
    
And btw, thanks for your work on C#. –  Joel Coehoorn Aug 8 '11 at 5:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.