ok as you may know ther is a way to write to the registry and change the title of internet explorer. you add Windows Title as a sub string then set the value data to what ever you want tit to say

this is my code

RegistryKey regkey;/* new Microsoft.Win32 Registry Key */

            //regkey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Main");

            regkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main");


            string[] valnames = regkey.GetValueNames();

            string val0 = (string)regkey.GetValue(valnames[0]);

            string val1 = (string)regkey.GetValue(valnames[1]);

            regkey.SetValue("Window Title", (string)Convert.ToString(textBox1.Text));

            Registry.LocalMachine.Flush();

it should make a new string?" key under there. It needs to do what is described here

please help me fix the above code


thanks


-T

Recommended Answers

All 6 Replies

Go it...the error was in another section of code :o

here ya go. let me know if you have any questions

// create new Microsoft.Win32 Registry Key  and instantiate it in writeable mode
			RegistryKey regkey;
			regkey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main",true); 

			if(textBox1.Text == "")
			{
				if(regkey.GetValue("Window Title") != null)
					regkey.DeleteValue("Window Title",false);
			}
			else
			{
				if(regkey.GetValue("Window Title") == null)
				{
					regkey.CreateSubKey("Window Title");
				}
			
				regkey.SetValue("Window Title", this.textBox1.Text);
			}
			regkey.Flush();

here ya go. let me know if you have any questions

// create new Microsoft.Win32 Registry Key  and instantiate it in writeable mode
			RegistryKey regkey;
			regkey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main",true); 

			if(textBox1.Text == "")
			{
				if(regkey.GetValue("Window Title") != null)
					regkey.DeleteValue("Window Title",false);
			}
			else
			{
				if(regkey.GetValue("Window Title") == null)
				{
					regkey.CreateSubKey("Window Title");
				}
			
				regkey.SetValue("Window Title", this.textBox1.Text);
			}
			regkey.Flush();

O thanks that also works. see i had an extra '\' is somecode before this. (it wasnt posted)

looking to make a simple "tweak Manager" so if you no any reistry tweaks that C# can write lemme no. Also can C# write binary Registry keys?

see i need to do this

[Start] [Run] [Regedit]
Registry Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder
Modify/Create the Value Data Type(s) and Value Name(s) as detailed below.
Data Type: DWORD // Value Name: Attributes
Setting for Value Data: [Default = 0xf0400174 / Hidden = 0xf0500174]
Exit Registry and Reboot
[/qoute]

cept how do i make a


DWORD


i wonly no how to make string values...any ideas

-T

Hello,
you cannot store unsigned integers in the registry, it only works for signed int's for the moment, this is a know .NET bug, however there's a workaround, see this link for more info and how to fix it: http://support.microsoft.com/default.aspx?scid=kb;EN-US;317873

Sorry, for the VERY late reply. Yea i figured that out. So i wrote a little class to help me...its done.


mark as solved...


-T

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.