Help with writing ScreenSaver

Capt_Ron

Active member
Joined
Apr 29, 2005
Messages
39
Programming Experience
1-3
I'm using the sample Screensaver in VS2005 and I want to alter it to do 1 thing and I cant figure it out.

If the screensaver has been on for more than 2 minutes, I want it to do a forced logoff on the computer.

Any direction would be helpful
Thank you
Ron
 
You would use a Timer and set its Interval 120,000 (milliseconds). In the Timer's Tick or Elapsed event handler (depending on whether you use a Windows.Forms.Timer or a Timers.Timer) you would call Process.Start to execute the shutdown.exe program. See the Windows documentation or use a Console window to determine the appropriate commandline arguments to have shutdown.exe perform a logout.
 
Back
Top