Example #1
0
        private static void RunScreensaver()
        {
            int i = System.Windows.Forms.Screen.AllScreens.Count();
            Dictionary<int, ScreenSaverForm> screenMap = new Dictionary<int, ScreenSaverForm>();

            for (int x = 0; x < i; x++)
            {
                screenMap[x] = new ScreenSaverForm();
            }

            int j = 0;
            foreach (System.Windows.Forms.Screen screen in System.Windows.Forms.Screen.AllScreens)
            {
                screenMap[j].Left = screen.Bounds.Width;
                screenMap[j].Top = screen.Bounds.Height;
                screenMap[j].Location = screen.Bounds.Location;
                Point p = new Point(screen.Bounds.Location.X, screen.Bounds.Location.Y);
                screenMap[j].Location = p;
                screenMap[j].Show();
                j++;
            }

            Browser browser = new Browser();
            //browser.Show();

            Application.Run();
        }
Example #2
0
 /// <summary>
 /// Display the form on each of the computer's monitors.
 /// </summary>
 static void ShowScreenSaver()
 {
     foreach (Screen screen in Screen.AllScreens)
     {
         ScreenSaverForm screensaver = new ScreenSaverForm(screen.Bounds);
         screensaver.Show();
     }
 }
Example #3
0
 static void ShowScreenSaver()
 {
     foreach (Screen screen in Screen.AllScreens)
     {
         ScreenSaverForm screensaver = new ScreenSaverForm(screen.Bounds);
         //Rectangle size = new Rectangle(0,0,800,600);
         //ScreenSaverForm screensaver = new ScreenSaverForm(size);
         screensaver.Show();
     }
 }
Example #4
0
        /// <summary>
        /// Display the form on each of the computer's monitors.
        /// </summary>
        static void ShowScreenSaver()
        {
            int i = 0;
            var multiscreenDisabled = new RegSettings().MultiscreenDisabled;
            foreach (Screen screen in Screen.AllScreens)
            {
                ScreenSaverForm screensaver = new ScreenSaverForm(screen.Bounds);

                // disable video on multi-displays (3+) except the first
                if (Screen.AllScreens.Length > 2 && i != 0 && multiscreenDisabled)
                    screensaver.ShowVideo = false;

                i++;
                screensaver.Show();
            }
        }
Example #5
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Check for any passed arguments
            if (args.Length > 0)
            {
                switch (args[0].ToLower().Trim().Substring(0, 2))
                {
                    // Preview the screen saver
                    case "/p":
                        // args[1] is the handle to the preview window
                        ScreenSaverForm screenSaverForm = new ScreenSaverForm(new IntPtr(long.Parse(args[1])));
                        screenSaverForm.ShowDialog();
                        Application.Run();
                        break;

                    // Show the screen saver
                    case "/s":
                        RunScreensaver();
                        break;

                    // Configure the screesaver's settings
                    case "/c":
                        // Show the settings form
                        SettingsForm settingsForm = new SettingsForm();
                        settingsForm.ShowDialog();
                        break;

                    // Show the screen saver
                    default:
                        RunScreensaver();
                        break;
                }
            }
            else
            {
                // No arguments were passed so we show the screensaver anyway
                RunScreensaver();
            }
        }