views:

478

answers:

2

REASON: I'm working on an emergency alert application that needs to display information on a desktop. When the client receives an alert, it pops up a window. If a screensaver is active or the monitor is in standby the alert will not be visible. I'm wondering if it's possible to wake the computer up via some sort of programatic mouse move or system call so that the alert would be visible. I think the reason a mouse move or keypress wakes it up is because of a hardware interrupt so it may not be possible.

Currently, the project is being implemented in C#. I'm interested to hear about solutions for Windows, MAC, and Linux.

This is a customer request. I have considered the following:

  • On most computers after inactivity, the user must login. Those computers will not get the alert
  • There is a good chance that if a screensaver is active, then noone is at the computer anyway.

I am NOT trying to:

  • Prevent a screensaver or energy savings mode to be activated all together.
+2  A: 

http://support.microsoft.com/kb/140723

fbonnet
Thanks. That link is very helpful. Anyone have a C# implementation?
blak3r
+3  A: 

Building on what fbonnet said, to use the functions shown in the kb article in C# the pinvoke.net site is a great resource. They also have a article on the PostMessage function here.

So the basic way of getting your code working could be searching the functions listed in the kb article on the pinvoke.net site. Or you can read this article has done that for you.

EKS