tags:

views:

4391

answers:

9

I have noticed that when I run Windows Media Player on my laptop, that the screen saver will not start and more importantly my computer will not go into sleep or hibernate mode. However, when running iTunes or other applications, unless you move your mouse or hit a key on your keyboard your computer will eventually go into sleep or hibernate mode. I want to write a little application that will prevent my computer from going into sleep or hibernate mode. Does anyone have any ideas on how this could be done?

A: 

Just go into your power management settings and disable going to sleep or going into hibernate

MrWiggles
Why the downvote? The OP didnt specify they want to be able to do it from within an application, just that they wanted to do it
MrWiggles
"I want to write a little application that will prevent my computer from going into sleep or hibernate mode..."
victor hugo
A: 

move your mouse around ;-)

seriously i seem to remember a WTF story about someone sitting a mouse in a baby rocking chair to stop a box hibernating as their sysadmins wouldn't let them change the settings.

chillitom
Homer Simpson had another great solution along those lines. http://ratsoup.com/wp-content/uploads/2008/06/drinking-bird.jpg
Kibbee
+4  A: 

For application - you may want to look at win32 function SetThreadExecutionState

Anyway, you could set different power scheme in windows control panel to let computer stay awake all the time.

Jiri
+3  A: 

You've got several events to handle to acheive this. First up, process the WM_SYSCOMMAND message, specifically the SC_SCREENSAVE and SC_MONITORPOWER options. Secondly, handle the WM_POWERBROADCAST message and return BROADCAST_QUERY_DENY.

However, MS decided to allow the BROADCAST_QUERY_DENY to be ignored by the system so it'll only work where it's allowed to work, usually a user setting. Too many applications were preventing power-down that the feature was effectively redundant.

Skizz

Skizz
A: 

Go to START then type cmd then in cammand window type powercfg/hibernate on

Hira Singh
A: 

yeah currently have the same problem. im running win7 and have changed all the options in power management to the "never" state when on power as i have always done since xp. Still it doesnt seem to do jack! i get up in the morning and then have to wake the puter up also. ive checked and checked and checked some more but the damn this still wants its shut eye!

where to now ?

Phil
A: 

Write a small program that stores the mouose position, then moves the mouse a little and back again.

ck
A: 

Windows 7 will not allow me, despite setting it to NEVER HIBERNATE AND NEVER SLEEP, to do just that. Another set of micosoft bullshit no one can use and wont do what its told. Solution, buy a mac. thats what im on my way out to do. Anyone wanna buy a desktop?

Tiffany
A: 

There is a small exe program called mouse wiggle you may want to check out.

JB
Please provide a link to this application.
John Saunders