Posted by: kurtsh | November 21, 2011

TOOL: “Insomnia” – Keep your Windows Desktop from going to sleep

image

David Anson wrote a tool that will keep your computer awake by disabling Sleep mode as long as the application is on.  It stays in the foreground so you can’t forget about it but it’s a very useful little tool for folks that work at companies with draconian Power Management policies.  (AHEM)

The default power settings for Windows are set up so a computer will go to sleep after 15 to 30 minutes of inactivity (i.e., no mouse or keyboard input). This is great because a computer that’s not being used doesn’t need to be running at full power. By letting an idle machine enter sleep mode, the user benefits from a significant reduction in electricity use, heat generation, component wear, etc.. And because sleep mode preserves the state of everything in memory, it’s quick to enter, quick to exit, and doesn’t affect the user’s work-flow. All the same applications continue running, windows stay open and where they were, etc.. So sleep mode is a Good Thing and I’m a fan.

However, sometimes a computer is busy even though someone isn’t actively using the mouse and keyboard; common examples include playing a movie, burning a DVD, streaming music, etc.. In these cases, you don’t want the machine to go to sleep because you’re using it – even though you’re not actually using it! So most media players and disc burners tell Windows not to go to sleep while they’re running. In fact, there’s a dedicated API for exactly this purpose: the SetThreadExecutionState Win32 Function.

But what about those times when the computer is busy doing something and the relevant program doesn’t suppress the default sleep behavior? For example, it might be downloading a large file, re-encoding a music collection, backing up the hard drive, or hashing the entire contents of the disk. You don’t want the machine to go to sleep for now, but are otherwise happy with the default sleep behavior. Unfortunately, the easiest way I know of to temporarily suppress sleeping is to go to Control Panel, open the Power Options page, change the power plan settings, commit them – and then remember to undo everything once the task is finished. It’s not hard; but it’s kind of annoying…

Read more here:
http://blogs.msdn.com/b/delay/archive/2009/09/30/give-your-computer-insomnia-free-tool-and-source-code-to-temporarily-prevent-a-machine-from-going-to-sleep.aspx


Categories

%d bloggers like this: