PostMessage( WM_SYSCOMMAND, SC_SCREENSAVE );
For stopping windows screen saver - use SystemParametersInfo() for knowing whether screen saver is running or not and if running close the foreground window.
if( ::SystemParametersInfo( SPI_GETSCREENSAVERRUNNING,0,&bSaver,0 ))
{
if( bSaver )
{
::PostMessage (::GetForegroundWindow(), WM_CLOSE, 0L, 0L);
}
}
No comments:
Post a Comment