When creating applications, it is often necessary to store (application related) data on the file system. You may choose to create your own file type (with a *unique* extension) and then associate that extension with your application through Windows. This tells Windows to automatically run your application when a user double-clicks a file in Windows Explorer, for example.
The source code accompanying (download) this tip shows how to:
- Get Associated application by Extension - if you need to register a file type (extension), be sure that it si not already registered by some other application.
- Associate a filetype (extension) with your application: description + code
- Finally, when a user double click a file with "your" extension, Windows will run your application. The ParamStr can be used to get the file being selected.
- Note: if you want to react when a user drags and drops a file on your (already) running application, or on the TaskBar, you need to handle some special file-drag-drop-accept Windows messages.
Delphi tips navigator:
» Activate a Running Instance of an Application when a User Openes an Associated File by Extension
« How to Use a Function or a Procedure as a Parameter in another Function


