Thread: how?
View Single Post
Old 02-28-2007, 06:47 PM   #4 (permalink)
Jeff
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Age: 28
Posts: 4,886
Default

You have to register the exe with the registry startup key.

This is what I did with CUO Desktop.

Code:
		private void SetLoadWithWindows(bool load)
		{
			try
			{
				string regkey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
				using( RegistryKey key = Registry.LocalMachine.CreateSubKey(regkey) )
				{
					if( load )
						key.SetValue("cuodesktop", Path.Combine(Paths.ApplicationPath, "CUODesktop.exe"));
					else
						key.DeleteValue("cuodesktop", false);

					key.Close();
				}
			}
			catch
			{
			}
		}
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote