How do I detect Windows turning on/off display (going to away mode)?

0

0

I'm trying to find a way to detect when my computer decides I've been away (no user input) long enough to turn off the display. That also means I'm not watching movies and the OS is not prohibited from turning off the display by any media players.

So far I found out that it may be possible to schedule a task to run if an event occurs, through Task Scheduler, a built-in Windows component. But I couldn't find such an event as turning on (off) the display in system event logs. Is there even such an event to begin with? Maybe I'm not using the correct tools for the job.

Anyway, I'd like to be able to detect when Windows turns the display on and off (two separate events) so that I could run a certain process when these events occur. How do I do that?

Note: I need this to work reliably when the screen is turned on or off by Windows, so any timers and applications "watching" after media players are not the desired solution.

user1306322

Posted 2013-08-09T23:08:40.183

Reputation: 4 237

Do you mean automatically? Or with a script that you have to run manually? – imtheman – 2013-08-09T23:30:00.557

I'd like the process to be suspended when the OS thinks I'm away without me doing anything, because it's obviously impossible, since I will not be present at the computer at that moment. – user1306322 – 2013-08-10T00:04:58.810

Assuming the program hasn't been discontinued by the author, I would contact said author and make a bug report. This won't help much, short-term, but long-term you and anyone else using this program might benefit from this bug being squashed. – TSJNachos117 – 2013-08-10T00:24:05.263

What process? what is "going nuts"? We cannot see what is occuring, although you could explain it. . Why do you allow the computer to go into any sleep/standby modes of any sort if the program does not behave in those circumstances? – Psycogeek – 2013-08-10T01:01:08.480

What kind of process is it? Can you give more information? Apart from this, the only thing I would say is that it doesn't seem that the process is working as well as it should. EDIT: Anyway... as stated previously in a (now deleted) post, the Task Scheduler has the ability to run programs and scripts at a certain time. It has actually a lot of functions that might help solve your problem, and if the options don't suffice you could make a script that kills the process. – Doktoro Reichard – 2013-08-09T23:34:55.630

It's a lighting manager application that can't handle a few things when the computer is in "away" mode. The developers are gone and I'm still trying to enjoy their little piece of software, but apparently it wasn't made for modern OSs. – user1306322 – 2013-08-10T00:09:20.503

Define "away" mode please. I believe it might have something to do with the power management configurations. If every power saving configuration is off (by this I say no screen saver, no monitor shutting off, no disks shutting off, etcetera) then, it may be either a bug, as stated before, or something else, to which we need more information. – Doktoro Reichard – 2013-08-10T00:36:57.660

1It has to do with the application that tries to do the amount of work it could during my break, making the PC unresponsive for as long as I was away. I can't debug that, the developers aren't there anymore for that too, so this is an attempt to work around this issue. But did you really need that information to answer my question? – user1306322 – 2013-08-10T01:01:14.143

Only to understand it. "Away" can mean a lot of things... At any rate it seems workarounds such as the ones mentioned above will work. – Doktoro Reichard – 2013-08-10T02:25:07.130

Answers

0

Process explorer lets you suspend/resume processes, though naturally, you need to test it in the specific scenario.

Alternately, its a bit of a workaround but you could probably get some bit of software that would emulate mouse jiggles- Mouse Jiggler was suggested here and should do the trick. You might be able to, alternately work out some mechanical way to do so.

Journeyman Geek

Posted 2013-08-09T23:08:40.183

Reputation: 119 122

Or I could just disable the "away" mode altogether, but that's not what I am after here. – user1306322 – 2013-08-10T01:04:50.603

True. Updated my answer with process explorer, which was what I was actually trying to remember ;p – Journeyman Geek – 2013-08-10T01:06:16.187

I know about Process Explorer and its ability to put processes under suspension, that's how I learned this issue can be countered by suspending the process. – user1306322 – 2013-08-10T01:06:50.957

http://superuser.com/questions/426351/suspend-resume-a-process-the-easy-way looks like pssuspend method tied to the taskscheduler triggers/events. might pull it off. – Psycogeek – 2013-08-10T02:17:53.133

I updated my question about 50 minutes ago with results of such attempts. – user1306322 – 2013-08-10T02:36:46.957

If the screen-off is initiated on idle, could a person use an idle condition? Trying to get a perfect setup in the task scheduler has never been easy for me, lots of tweaking and even remaking of a batch to fit its methods. – Psycogeek – 2013-08-10T04:57:54.183