1. Technology
Send to a Friend via Email

Activate a Running Instance when a User Opens an Associated File (By Extension)


If you have registered your own file type (extension) for an application, you can tell Windows to start your application when a user double clicks the file (or selects "Open" from the context popup menu) in the Windows Explorer.

The ParamStr can be used to get the file(s) being processed.

A side efect of a user selecting (double clicking) more than one file is that Windows will start as many instances of your application as there are files being "selected".

In most situations, you will want only one instance of your application to open all the files being processed.

If this is the case, you need the following handled:

Delphi tips navigator:
» Programmatically Open the Recycle Bin from Delphi Code
« How to Run your Application by Double-Clicking on a File (Register Extension)

©2014 About.com. All rights reserved.