所有的鸟儿他们都知道, 他们的巢应该筑在什么地方, 鸟儿知道自己该在什么地方筑巢, 那就意味着他们了解他们自己的使命。 我们身为万物之灵的人类, 怎么会不知道,连鸟儿都知道的道理呢?
自定义浏览器协议  ( Pluggable Protocol handler)
自定义浏览器协议 ( Pluggable Protocol handler)

自定义浏览器协议 ( Pluggable Protocol handler)

QQ的:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\TENCENT]
@="TencentProtocol"
"URL Protocol"="C:\\Program Files\\Tencent\\QQ\\Timwp.exe"

[HKEY_CLASSES_ROOT\TENCENT\DefaultIcon]
@="C:\\Program Files\\Tencent\\QQ\\Timwp.exe,1"

[HKEY_CLASSES_ROOT\TENCENT\shell]

[HKEY_CLASSES_ROOT\TENCENT\shell\open]

[HKEY_CLASSES_ROOT\TENCENT\shell\open\command]
@="\"C:\\Program Files\\Tencent\\QQ\\Timwp.exe\" \"%1\""

PPlive的:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Synacast]
@="URL:synacast Protocol"
"Version"="1.5.38"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\Synacast\DefaultIcon]
@="C:\\Program Files\\PPLive\\PPLive.exe"

[HKEY_CLASSES_ROOT\Synacast\Shell]

[HKEY_CLASSES_ROOT\Synacast\Shell\Open]

[HKEY_CLASSES_ROOT\Synacast\Shell\Open\Command]
@="C:\\Program Files\\PPLive\\PPLive.exe \"%1\""

通过多方查找终于发现是注册表这两项在起作用,原来只要在注册表里象添加文件扩展名一样,添加两个Synacast和TENCENT扩展名来,IE就会自动查找到这里来调用相应的程序。IE果然和windows系统内核整合起来了!原来注册表扩展名项还有这种作用,自己见识太少了,这种方法实现IE地址的自定义估计是最简单的了。

参考:
MSDN: Registering an Application to a URL Protocol     译文 http://www.cnblogs.com/volnet/archive/2008/03/26/registering_an_application_to_a_url_protocol.html
IE浏览器 自定义地址协议的实现 http://www.cnblogs.com/boringlamb/archive/2008/03/19/1113269.html
http://blogs.gotdotnet.com/noahc/archive/2006/10/19/register-a-custom-url-protocol-handler.aspx
自訂URL Protocol http://www.cnblogs.com/hwade/archive/2008/01/08/1029686.htm

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注