Notify when screensaver starts running

Post date: Aug 27, 2009 1:47:45 PM

More info here

http://www.codeproject.com/KB/cs/ScreenSaverControl.aspx

[DllImport("user32", CharSet=CharSet.Auto)]
public static extern int SystemParametersInfo(int uiAction, int uiParam, ref bool pvParam, int fWinIni);
public static int screensaveractive =Win32Api.wins_Fields.SPI_GETSCREENSAVEACTIVE;
public const int screensaverrunning =0x72 ;
public static bool bScreenSaverrunning =false;
while(1)
{
    int i=SystemParametersInfo(screensaverrunning, 0, ref bScreenSaverrunning, 0);
     if (constants.bScreenSaverrunning)
     {
         MessageBox.Show("Screen Saver has Now started");
     }
}