How to set up program with set as default editor option
Posted: Sat May 20, 2006 5:15 pm
Ok I am going to show you how to make a program have a set as default editor button (I am using pics from the app i am working on now)
First: Make a button on menustrip or where ever you want it. Then name it set as default editor

Second: View the code of the form and at the very top put
Then double click the set as default editor button you made, Put this code in it
Just fill in the places with 'name of project here' with your project name.
Now the halo 2 map icons will be the icon of your app, and when you double click the maps it should open up your app
here are what my map files look like, it has the icon of my project

Hope this helps someone.
EDIT: this is in vb 2005 EE
First: Make a button on menustrip or where ever you want it. Then name it set as default editor

Second: View the code of the form and at the very top put
Code: Select all
Imports Microsoft.Win32
Code: Select all
If MsgBox("Are you sure you want to set 'name of project here' as the default map editor?", MsgBoxStyle.YesNo, "Set As Default Map Editor?") = MsgBoxResult.Yes Then
Dim regKey As RegistryKey
regKey = Registry.ClassesRoot.CreateSubKey("'name of project here'\")
regKey.SetValue("", "Halo 2 Map File")
regKey = Registry.ClassesRoot.CreateSubKey("'name of project here'\shell\open\command")
regKey.SetValue("", Application.ExecutablePath & " %1")
regKey = Registry.ClassesRoot.CreateSubKey("'name of project here'\DefaultIcon")
regKey.SetValue("", Application.ExecutablePath & ",0")
regKey = Registry.ClassesRoot.CreateSubKey(".map")
regKey.SetValue("", "'name of project here'")
regKey.Close()
MsgBox("Done.", MsgBoxStyle.Information, "Registry Information:")
End If
Now the halo 2 map icons will be the icon of your app, and when you double click the maps it should open up your app
here are what my map files look like, it has the icon of my project

Hope this helps someone.

EDIT: this is in vb 2005 EE