The system supports the creation of new objects in system containers, such as folders and the desktop. Register information for each file type that you want the system to include. The registered type will appear on the New command that the system includes on menus for the desktop, folders, and the Open and Save As common dialog boxes. This provides a more data-centered design because the user can create a new object without having to locate and run the associated application.
To register a file type for inclusion, create a subkey using the Application Identifier under the extension's subkey in HKEY_ CLASSES_ROOT. Under it, also create the ShellNew subkey.
HKEY_CLASSES_ROOT
.ext = ApplicationIdentifier
ApplicationIdentifier
ShellNew Value Name = Value
Assign a value entry to the ShellNew subkey with one of the four methods for creating a file with this extension.
Value name |
Value |
Result |
Data |
binary data |
Creates a new file containing the binary data. |
FileName |
path |
Creates a new file by copying the specified file. |
Command |
filename |
Carries out the command. Use this to run your own application code to create a new file (for example, run a wizard). |
The system also will automatically provide a unique filename for the new file using the type name you register.
When using a Command value, place your application file (that creates the new file) in the directory that the system uses to store these files. To determine the path for that directory, check the setting for the Templates value in the Shell Folders subkey found in HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Explorer. Then you need only register the filename for the command.