如何让我的文件关联在单个程序实例中打开多个文件? [英] How Can I Get My File Association to Open Multiple Files in a Single Program Instance?
问题描述
我已经在注册表中为我的程序设置了一个文件扩展名根据 Windows 的要求.
I have set up a file extension in the Registry for my program as Windows requires.
在注册表中,在 shell/open/command 下,我有:
In the Registry, under shell/open/command, I've got:
"C:MyProgramPathMyProgram.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?
推荐答案
当使用 DDE一>.请参阅 http://cc.embarcadero.com/Item/17787 以获取 Delphi 中的示例.
You can when using DDE. See http://cc.embarcadero.com/Item/17787 for an example in Delphi.
您提供的链接谈到了另一种方法:使用 IDropTarget.这可能更适合您已经运行的拖放功能.
The link you gave talks about another method: using IDropTarget. This might fit better with your already running drag and drop capabilities.
这篇关于如何让我的文件关联在单个程序实例中打开多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!