2

I am making a WPF C# program. For the next stage I want to create a message that appears on the screen after half an hour of inactivity. I define inactivity as no mouse movements and no keys pressed. I have two questions for this

1) How would I trigger the message to show after half an hour of inactivity?

2) How would I cancel the windows screensaver if it is running?

So far I have looked at:

You will see that frustrating most results point to creating a windows/linux screensaver rather than helping with my goal which is creating code that triggers from inactivity like the windows screensaver does.

Community
  • 1
  • 1
Brett
  • 3,296
  • 5
  • 29
  • 45

1 Answers1

1

Try looking at this article on code project.

The trick was to search for "System Idle" instead of "Screen Saver Effect".

(Credit to Darin Dimitrov's answer)

Community
  • 1
  • 1
gunr2171
  • 16,104
  • 25
  • 61
  • 88
  • Thanks @gunr2171 that really helped. The page you linked to was gone but I found many others by search System Idle. Here was the best http://stackoverflow.com/questions/1037595/c-sharp-detect-time-of-last-user-interaction-with-the-os. Thanks again! – Brett Mar 10 '13 at 06:04
  • No problem. Not sure why the links don't work, work fine for me. Try looking at the source of my post for the true links. – gunr2171 Mar 10 '13 at 16:29