{ // Determine if the mouse cursor position has been stored previously. if (ixStart == 0 && iyStart == 0) { //Store the mouse cursor coordinates. ixStart = e.X; iyStart = e.Y; return; } // Has the mouse cursor moved since the screen saver was started? else if (e.X != ixStart || e.Y != iyStart) StopScreenSaver();
/// <summary> /// The main entry point for the application. /// </summary> public static void Main(string[] args) { if (args.Length==1) { //Display the options dialog box. if (args[0].Substring(0,2).Equals("/c")) { MessageBox.Show("Options are not available for this screen saver", " C# Screen Saver", MessageBox.IconInformation); Application.Exit(); } //Start the screen saver normally. else if (args[0]=="/s") Application.Run(new ScreenSaver());
//Diaplay the password dialog else if (args[0]=="/a") { MessageBox.Show("Passwords are not available for this screen saver", " C# Screen Saver", MessageBox.IconInformation); Application.Exit(); } } //For any other args --> start. else Application.Run(new ScreenSaver()); }