Starting and Stopping the ScreenSaver

February 13, 2009 | By | Add a Comment

Starting and stopping the screensaver in C# can be done by calling the Windows API’s PostMessage function, which posts a message to the Windows Message Queue asynchronously. Starting it is straight forward. But stopping it is somewhat tricky. I accomplished this here by stopping the window on the foreground which will always be the screensaver if it is running.

 

Download Source Code

 



Related Posts:

Filed in: WinForms | Tags: ,

Leave a Reply

Trackback URL | RSS Feed for This Entry