The Registry contains FileType keys that identify specific file extensions as belonging to specific applications. This key allows the Windows shell functions to start an application for loading the file when the user double-clicks the file name in the Explorer or a shortcut for the file on the Windows desktop.
To associate a file type with your application, follow these steps:
Listing 19.23 - Registering the OLE File Type
; Comments: OLESTORE.REG REGEDIT ; Register OLESTORE.EXE. HKEY_CLASSES_ROOT\olestore.application = OLE Samples Storage View Utility ; Provide open and edit command lines for the Explorer HKEY_CLASSES_ROOT\olestore.application\shell\open\command @= c:\\vb5 se\\samples\chapter 17\\olestore.exe %1 HKEY_CLASSES_ROOT\olestore.application \shell\print\command @= c:\\vb5 se\\samples\\chapter 17\\olestore.exe %1 ; Associate .OLE file extension with the progID. HKEY_CLASSES_ROOT\.ole = olestore.application ; Enables drag-drop to program icon (starts application) [HKEY_CLASSES_ROOT\olestore.application\shellex\drophandler] @="{99920810-0000-0000-C000-000000000046}" : Adds OLEStore to File/New context menu from desktop [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.ole] @="olestore.application" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.ole\ShellNew] "Command"="c:\\vb5 se\\samples\\olestore.exe /n\"" @="OLE Storage File"
regedit /s olestore.reg
The Registry entries for OLESTORE.REG.