copy it into the system32 directory. But I am not able to use use it as a screen saver on my computer. How to do this
coding for form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace screensaver
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Bounds = Screen.PrimaryScreen.Bounds;
Cursor.Hide();
TopMost = true;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
Application.Exit();
}
private void Form1_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
coding for program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace screensaver
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length > 0)
{
if (args[0].ToLower().Trim().Substring(0, 2) == "s")
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
else if (args[0].ToLower().Trim().Substring(0, 2) == "p")
{
}
else if (args[0].ToLower().Trim().Substring(0, 2) == "c")
{
MessageBox.Show("the screensaver has no option ", "my screen saver", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
}

New Topic/Question
Reply




MultiQuote





|