如何让我的文件关联在单个程序实例中打开多个文件? [英] How Can I Get My File Association to Open Multiple Files in a Single Program Instance?

查看:25
本文介绍了如何让我的文件关联在单个程序实例中打开多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在注册表中为我的程序设置了一个文件扩展名根据 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆