如何创建一个"自定义协议"并将其映射到一个应用程序? [英] How do I create a "custom protocol" and map it to an application?

查看:245
本文介绍了如何创建一个"自定义协议"并将其映射到一个应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何一会去创建一个自定义协议?我知道你可以通过添加一些注册表项HKEY_CLASSES_ROOT中创建一个URL协议,但似乎只有在浏览器中运行。我需要它在Windows资源管理器的工作也。

How would one go about creating a "custom protocol?" I know you can create a URL protocol by adding a number of registry entries to HKEY_CLASSES_ROOT, but that seems to only work in a browser. I need for it to work in Windows Explorer also.

我知道我可以写界面的客户端/服务器排序,但我认为这是大材小用为我的客户的需求(和预算)。

I know that I can write a client/server sort of interface, but I think that is overkill for my client's needs (and budget).

长话短说...


  • 第三方应用程序需要调用: tbwx:其中,ROW_ID>

  • 我的应用程序加载并从数据库中删除记录。

这听起来相当简单(或因此我想)。任何想法?

It sounds fairly simple (or so I thought). Any ideas?

感谢

推荐答案

至少在Windows 7中,当您添加型 REG_SZ 来的钥匙的 URL协议值可以只要创建一个自定义的协议。它不需要一个实际值,只是需要存在。下面是一个回声协议的一个简单的例子,我刚刚创建了在资源管理器的工作原理。

At least on Windows 7, you can create a custom protocol as long as you add a URL Protocol value of type REG_SZ to the key. It doesn't need an actual value, just needs to be present. Here's a simple example of an "Echo Protocol" I just created which works in explorer.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\echo]
"URL Protocol"=""
@="Echo Protocol"

[HKEY_CLASSES_ROOT\echo\shell]

[HKEY_CLASSES_ROOT\echo\shell\open]

[HKEY_CLASSES_ROOT\echo\shell\open\command]
@="C:\\WINDOWS\\SYSTEM32\\CMD.EXE /Q /C (echo %1) && pause"

我发现它也将在键的工作 HKCU\Software\Classes HKLM\Software\Classes 太。它不是在但是控制Panel\Programs\Default Programs\Set协会列表中列出。其他键可能需要更新,或将它必须与Windows莫名其妙注册。

I've found it will also work in the keys HKCU\Software\Classes and HKLM\Software\Classes too. It isn't listed in the Control Panel\Programs\Default Programs\Set Associations list however. Other keys might need to be updated or it would have to be registered with Windows somehow.

我想这是相同的或老版本的Windows XP及以上的相似。

I imagine it is the same or similar in older versions of Windows XP and up.

这篇关于如何创建一个"自定义协议"并将其映射到一个应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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