If you want the file extension to be opened with your program (or any other), you must add entries in the registry.
If you're using MFC, in the wizard, in "Document Template Properties", "File Extension", you add the extension (for example "zzz") and it generates the code itself.
In the registry, the shell open operations go in HKEY_CLASSES_ROOT/.zzz.
If you have an MFC project, the registration occurs in CWinApp::RegisterShellFileTypes.
The .reg the MFC generates looks something like:
REGEDIT
; This .REG file may be used by your SETUP program.
; If a SETUP program is not available, the entries below will be
; registered in your InitInstance automatically with a call to
; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
HKEY_CLASSES_ROOT\.zzz = DDZ.Document
HKEY_CLASSES_ROOT\DDZ.Document\shell\open\command = DDZ.EXE %1
HKEY_CLASSES_ROOT\DDZ.Document\shell\open\ddeexec = [open("%1")]
HKEY_CLASSES_ROOT\DDZ.Document\shell\open\ddeexec\application = DDZ
; note: the application is optional
; (it defaults to the app name in "command")
HKEY_CLASSES_ROOT\DDZ.Document = DDZ.Document
If you really want really complex file extension management, you should create a shell extension dll. There is an excelent article on CodeProject:
The Complete Idiot's Guide to Writing Shell Extensions - Index[
^]