The application should detect if either screensaver has been activated or monitor has been turned off. If either of these two conditions is met, the user is considered idle.
I would like to incorporate this two events into my c# .net application. As far as I know this should probably be written as a c++ project.
## Deliverables
I would like to know when the user is idle. Lets say that windows considers user as idle if:
Screen saver is turned on
Monitor is turned off
It is quite easy to check if screen saver is turned on by calling SystemParametersInfo procedure. But I don't know of any reliable way to check if Windows turned off the monitor. It would be great if somebody found a solution to check if windows "thinks" the monitor is off (if it decided to turn it off due to inactivity).
There are also some system messages WM_SYSCOMMAND `(SC_MONITORPOWER),` which could be used to receive message when windows or any other application decides to turn off the monitor.
Any solution would be good as long as it works for all monitors (it isn't drivers related)
I would like to receive this event in my C# managed application, so this must be created as a dll with a .Net usage example.