sábado, 25 de julho de 2015

ScreenSaver

using System;
using System.Windows.Forms;

namespace Lapuinka.ScreenSaver
{
       public class ScreenSaver
       {
             [STAThread]
             static void Main(string[] args)
             {
                    if (args.Length > 0)
                    {
                           if (args[0].ToLower().Trim().Substring(0,2) == "/c")
                           {
                                  MessageBox.Show("Este screen saver não pode ser iniciado.", ".NET Screen Saver", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                           }
                           else if (args[0].ToLower() == "/s")
                           {
                                  for (int i = Screen.AllScreens.GetLowerBound(0); i <= Screen.AllScreens.GetUpperBound(0); i++)
                                        System.Windows.Forms.Application.Run(new ScreenSaverForm(i));                          
                           }
                    }
                    else
                    {
                           for (int i = Screen.AllScreens.GetLowerBound(0); i <= Screen.AllScreens.GetUpperBound(0); i++)
                                  System.Windows.Forms.Application.Run(new ScreenSaverForm(i));                         
                    }
             }

       }
Postar um comentário