How do you add an item to Explorer's ShellNew menu?
July 15, 2004 5:32 PM
Subscribe
I give up! Just how in the hell do you add an item to Explorer's ShellNew menu?
MSDN makes it sound easy:
To add a file-creation command to the New submenu, your application's files must have a file class associated with them. Include a ShellNew subkey under the file extension key. When the File menu's New command is selected, the Shell will add it to the New submenu. The command's display string will be the descriptive string that is assigned to the program's ProgID.
Assign one or more data values to the ShellNew subkey to specify the file creation method. The available values follow. [...]
So here's what I have: a file extension ".build" under HKEY_CLASSES_ROOT, with a ProgID of "NAnt.Buildfile." There's a "ShellNew" key under that with a "NullFile" value attached. (I want to use a template or possibly write a wizard, but I'll settle for getting the simplest case working first!) I've set up a corresponding "NAnt.Buildfile" key to give the file class a friendly name, a default icon, and a couple of verbs (Edit and Build). According to MSDN, this is more than the minimum required, but no new entry appears in the ShellNew menu; however, ".build" files appear with the icon I selected and fully-functional Edit and Build verbs. Figuring this is Windows and nothing is as easy as a couple registry entries, I've searched for some sort of API call I need to make to get Explorer to recognize the ShellNew entry but I've come up empty. Help!
posted by kjh to computers & internet (6 comments total)
Go back into regedit. Under .build, create a new key called ShellNew. Under ShellNew, create a new string value called FileName whose value is the name of the file you created above. Close regedit and check the ShellNew menu.
posted by Danelope at 6:03 PM on July 15, 2004