Search code examples
windowsshellregistryassociations

How Can I Get My File Association to Open Multiple Files in a Single Program Instance?


I have set up a file extension in the Registry for my program as Windows requires.

In the Registry, under shell/open/command, I've got:

"C:\MyProgramPath\MyProgram.exe" "%1" 

This works fine for me. When someone clicks on one or more files associated with my application, my application correctly opens the file(s) but each one is opened in a separate program instance.

Is there any way I can do this and open up all files in one program instance?


Solution

  • You can when using DDE. See http://cc.embarcadero.com/Item/17787 for an example in Delphi.

    EDIT:

    The link you gave talks about another method: using IDropTarget. This might fit better with your already running drag and drop capabilities.