Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How to disable sleep mode programmatically

20 May 2010   #1

Windows 7
How to disable sleep mode programmatically

I have a application that runs for several hours. The problem I am having is that Windows 7 goes to sleep while my application is running. I know I can manually disable the sleep mode, but I am hoping there is a way I can enable/disable the sleep mode from within my application. That way I can disable the sleep mode when my program starts and I can enable it again when my program finishes. Is there a way to do this? Is there another way to prevent Windows 7 from going to sleep while my program is still running? Is there a DontGoToSleepBecauseMyProgramIsStillRunning command that I can execute every few minutes to prevent Windows 7 from going to sleep while my program is running?

My System SpecsSystem Spec
20 May 2010   #2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86

You can download the app called Insomnia.
My System SpecsSystem Spec

 How to disable sleep mode programmatically

Thread Tools

Similar help and support threads
Thread Forum
video mode unuseable upon waking from sleep mode
I've been using this Windows 7 Home system for some years. At first it used the CRT monitor I had for much longer than this system, then a used LCD monitor, now for the last six or eight months a larger used, but seemingly in excellent condition, Dell E228WFP. My habit has been, for much longer...
Performance & Maintenance
Laptop freezes between entering sleep mode to being in sleep mode
hai.. help needed.... i am having the exact problem as op.. when i press sleep button, screen goes black (as usual).. but fan, and other keyboard lights are still on... it just freezes... i have to force shutdown to again use my laptop... i am attaching the msinfo32.nfo, driverview.txt... ...
General Discussion
Laptop freezes between entering sleep mode to being in sleep mode
Hi, I've had this problem intermittently on my laptop for the past 2 years however it has been occuring more often recently. Basically sometimes when I click the sleep button on Windows 7, the screen fades to black as usual. However the fan keeps running (sounds like when it's on full load) and...
General Discussion
How to programmatically change COM port FriendlyName
I have an installation script that changes the COM port numbers based on certain hardware that is installed. In Windows 2000, I use regini.exe to import the listing of registry entries below. The reason for this was to allow the permissions on the FriendlyName value to be changed. ...
Installation & Setup
Mute the audio mixer application programmatically
hello all, I try to mute/unmute the available application mixer individually (not the master sound). Does windows provided any API to get this thing done? Thanks for help...
Sound & Audio

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 22:54.
Twitter Facebook Google+