private void TimerTick(object sender, EventArgs e)
 {
     int lastinput = GetLastInputTime();
     if (lastinput >= mSeconds)
     {
         mTimer.Stop();
         var ss = new ScreenSaver();
         ss.ShowDialog();
         mTimer.Start();
     }
     Console.WriteLine(lastinput.ToString() + @"/" + mSeconds.ToString() + @" secondes");
 }
        private void StartScreenSaver()
        {
            var ss = new ScreenSaver();
            ss.WindowStartupLocation = WindowStartupLocation.Manual;
            Rectangle location = Screen.PrimaryScreen.Bounds;
            ss.WindowState = WindowState.Maximized;

            //creates window on other screens
            foreach (Screen screen in Screen.AllScreens)
            {
                if (screen == Screen.PrimaryScreen)
                    continue;

                var window = new ScreenSaver();
                window.WindowStartupLocation = WindowStartupLocation.Manual;
                location = screen.Bounds;

                //covers entire monitor
                window.Left = location.X - 7;
                window.Top = location.Y - 7;
                window.Width = location.Width + 14;
                window.Height = location.Height + 14;
            }


            ///shows primary screen window last
            ss.ShowDialog();
        }
 private void mnuPrev_Click(object sender, EventArgs e)
 {
     var ss = new ScreenSaver();
     ss.ShowDialog();
 }