Thursday, July 23, 2009

How to Start the ScreenSaver Programmatically?

Basically you have to send a WM_SYSCOMMAND to any of the windows with wParam as SC_SCREENSAVE. And what really happens in background is, the default window proc will get the message and will start the screen saver. So you can call the DefWindowProc() directly to start the screensaver. Have a look at the code snippet.

// Start the screen-saver
DefWindowProc( WM_SYSCOMMAND, SC_SCREENSAVE, 0 );

0 comments:

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP