|
EDIT: I figured it out myself... YAY!!! Here is how you register your own custom file type, and set your own custom Icon for it... Woo hoo!
You will need to have access to the registry, (user permission). We will be writing 3 registry keys, and modifying some values.
Registry Keys: [1] Class name. ( .yourextension ) [2] DefaultIcon [3] Content Type ( what kind of content is it? plain/text? )
The first registry key is the actual name of your extension, including the dot. This key will go under HKEY_CLASSES_ROOT.
Microsoft.Win32.Registry.ClassesRoot.CreateSubKey(".yourextension", RegistryKeyPermissionCheck.ReadWriteSubTree);
Next we need add the default icon...
Microsoft.Win32.Registry.ClassesRoot.CreateSubKey(".mainframe\\DefaultIcon", RegistryKeyPermissionCheck.ReadWriteSubTree);
Now we need to modify the default value to the location of the icon you want it to use... (wherever the icon is on the hard drive).
Microsoft.Win32.Registry.ClassesRoot.SetValue(".yourextension\\DefaultIcon\\Default", "path to your icon");
Now to add the type of content it is....(this is optional)
Microsoft.Win32.Registry.ClassesRoot.SetValue(".yourextension\\Content Type\\Default", "mime type");
You're done!! If you encounter any problems, post them! (I wrote this extremely fast out of excitement)
|