CWinApp::RegisterShellFileTypes
Call this member function to register all of your application's document types with the Windows File Manager.
void RegisterShellFileTypes( BOOL bCompat = FALSE );
This allows the user to open a data file created by your application by double-clicking it from within File Manager. Call RegisterShellFileTypes after you call AddDocTemplate for each of the document templates in your application. Also call the EnableShellOpen member function when you call RegisterShellFileTypes.
RegisterShellFileTypes iterates through the list of CDocTemplate objects that the application maintains and, for each document template, adds entries to the registration database that Windows maintains for file associations. File Manager uses these entries to open a data file when the user double-clicks it. This eliminates the need to ship a .REG file with your application.
Note
|
|---|
|
RegisterShellFileTypes only works if the user runs the program with administrator rights. If the program does not have administrator rights, it cannot alter registry keys. |
If the registration database already associates a given filename extension with another file type, no new association is created. See the CDocTemplate class for the format of strings necessary to register this information.
Note