
The windows registry contains a list of all registered file types based on their extension. The API also provides a method for enumerating through the list of extensions, locating all registered types, finding their associated application and a plain english description of the application along with the icon associated with the application for that file type.
By selecting 'RUN' from the start menu and then entering the program name 'REGEDIT' it is possible to view the registry. The graphic above shows in the first image the registry key associated with a certain file extension. In this case it is 'AIM' which is associated with that AOL online chat system that comes bundled with Netscape. The file extensions and related information are stored in the ' HKEY_CLASSES_ROOT ' key. The fact that a key is a registered file extension is indicated by the period at the beginning of the key name. When the key ' .aim ' is opened a string is displayed on the right, in this case 'aimfile'. This string is the name of another key which contains the plain english description of the program plus its icon (and is also located further on in the ' HKEY_CLASSES_ROOT ' key). The next image shows the 'aimfile' opened and the plain text description of the application associated as the text for this key. The last image shows the subkey 'DefaultIcon' opened in the 'aimfile' key which indicates where the icon to be displayed for such a file type is to be found.
The demo project included below shows how to scan the registry for all registered file extensions in the procedure EnumRegKey. The file extensions are identified by the period at the beginning of each key name and then stored in a string list ExtSL. After the enumeration is complete the keys must then be read to find the second key which contains the description of the application as well as its icon. The program uses this stringlist of file extensions to read each key and find the name of the Associated application key in the registry procedure GetAssocAppInfo. The stringlist EXTSL then becomes a comma delimited list, of the form FILE EXTENSION, ASSOCIATED APP KEY NAME. Using this key name it then finds and opens each Associated Application key in the registry to find the plain English text description of the Application associated with each file extension in the procedure GetDescStrings. These will wind up being stored in a stringlist NamesSL in comma delimited form as File Extension, Plain text description of associated application, which will then be ready to be transferred to a ListView for display. Next in Procedure GetIcons the program uses this second comma delimited list (NamesSL) to find the icon associated with each file extension and then to post the extension, the description, and the icon to a listview for display. The graphic below shows the end result with all the registered file extensions in the registry and the application string displayed on a ListView.
The code that accomplishes this was created using Delphi 3, and also runs on Delphi 5, and probably other versions as well. You can download the project as a zip file from the following link ... regfiles.zip 13kb
Also of interest is the Shell\Open\Command key...Changing the default program used to launch a certain file type based on the file association in the registry ... Added January 25, 2003...In this simple example the application will become the default for text files, displaying any text file clicked in Windows Explorer in a simple Memo component. You will need to drop two buttons and a memo onto a form and then paste in the code from this text file (remembering to click the buttons to initialize the click event code).
A Unified Field Theory
![]()
The Unified Field Theory
is also available as a zip file -> unified.zip
Introduction :The Pioneer Effect and the New Physics. A brief description of the new physics required to explain the 'Pioneer Effect', which is the constant deceleration of space craft as they fly through space.

