I am programming a App that adds Strings to the Registry to add custom URLs and Programs/ShortCuts to the context menu. I'm stuck at this point because it doesn't let me write a string to the registry and says some weird error.
Here is a photo (sorry for some things in German :D ):
And here is the text what is missing / cut on the photo:
I tried it with this code:
My.Computer.Registry.ClassesRoot.CreateSubKey("DesktopBackground\Shell\Settings")
My.Computer.Registry.ClassesRoot.CreateSubKey("DesktopBackground\Shell\Settings\command")
My.Computer.Registry.ClassesRoot.SetValue("Computer\HKEY_CLASSES_ROOT\DesktopBackground\Shell\Settings", "(Default)", "@shell32.dll,-4161")
My.Computer.Registry.ClassesRoot.SetValue("Computer\HKEY_CLASSES_ROOT\DesktopBackground\Shell\Settings", "icon", "Control.exe")
My.Computer.Registry.ClassesRoot.SetValue("Computer\HKEY_CLASSES_ROOT\DesktopBackground\Shell\Settings", "Position", "Middle")
My.Computer.Registry.ClassesRoot.SetValue("Computer\HKEY_CLASSES_ROOT\DesktopBackground\Shell\Settings\command", "(Default)", "Control.exe")
I think it comes because it tries to write it as a integer and i try to wrtie a string, but i dont know how to use a String as a type.
Here is the full code: Form1: http://txt.do/drqp1 Form2: txt.do/drqpt
[SOLVED] Availible on GitHub: https://github.com/amir00t/LvL-up