views:

35

answers:

1

How times changed the screensaver

screensaver

Code View :

            RegistryKey screenSaverKey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop");
        if (screenSaverKey != null)
        {
            string screenSaverFilePath = screenSaverKey.GetValue("SCRNSAVE.EXE", string.Empty).ToString();
            if (!string.IsNullOrEmpty(screenSaverFilePath) && File.Exists(screenSaverFilePath))
            {
                Process screenSaverProcess = Process.Start(new ProcessStartInfo(screenSaverFilePath, "/s"));  // "/s" for full-screen mode
                screenSaverProcess.WaitForExit();  // Wait for the screensaver to be dismissed by the user
            }
        }
A: 

You can change wait time of screen saver with ScreenSaveTimeOut value. ScreenSaveTimeOut is under same path @"Control Panel\Desktop" on registry. This key hold second type value.

For example 1 minute ScreenSaveTimeOut = 60

5 minutes ScreenSaveTimeOut = 300

Mehmet Taskopru
@Mehmet Taskopru: Please check with the coding examples
ehsan_d18