3 Replies - 568 Views - Last Post: 24 August 2009 - 07:22 AM Rate Topic: -----

#1 prince11  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 12-August 09

having problem in screen saver application

Post icon  Posted 23 August 2009 - 02:30 AM

i had changed the extension of my build application from .exe to .scr, and
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());


			}

			
			
			
		   
		}
	}
}



Is This A Good Question/Topic? 0
  • +

Replies To: having problem in screen saver application

#2 debjit625  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 446
  • Joined: 06-September 08

Re: having problem in screen saver application

Posted 23 August 2009 - 02:39 PM

If the scr file is running properlly then go to desktop->right click ->click properties->then select screen saver tab ->from the list box select your screen saver.
Was This Post Helpful? 0
  • +
  • -

#3 prince11  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 12-August 09

Re: having problem in screen saver application

Posted 24 August 2009 - 05:05 AM

View Postdebjit625, on 23 Aug, 2009 - 01:39 PM, said:

If the scr file is running properlly then go to desktop->right click ->click properties->then select screen saver tab ->from the list box select your screen saver.


the application is running properly but when I select screen saver tab the name of my screen saver application is not shown in the list box. What to do then.


the application is running properly but when I select screen saver tab the name of my screen saver application is not shown in the list box. What to do then.
Was This Post Helpful? 0
  • +
  • -

#4 debjit625  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 446
  • Joined: 06-September 08

Re: having problem in screen saver application

Posted 24 August 2009 - 07:22 AM

Let your file name is My.exe
then dont just rename it using explorer use dos command
REN My.exe My.scr



And let me know after that
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1