tencent://message协议

|举报|字号 订阅

 
 

相信很多朋友在访问别人的博客、网上商城时可能会发现上都有这样的小玩意, 点击下就可以弹出对话框和主人进行对话,而且无需加对方为好友。

◆腾讯提供的代码为:(腾讯官方链接: http://is.qq.com/webpresence/code.shtml

<a href="tencent://message/?uin=88888888&Site=JooIT.com&Menu=yes">
<img border="0" SRC='http://is.qq.com/webpresence/images/status/01_online.gif' alt="点击这里给我发消息">
</a>

有时在浏览器地址中输入:  tencent://message/?uin=*********  (********代表对方QQ)就可以弹出对话框和对方进行对话,同样无需加对方为好友(前提是对方没有设置身份认证)。也可在cmd中执行start tencent://message/?uin=********* 也可有相同效果。注:tencent://message/?uin=*********&Site=&Menu=yes  这是QQ推出的新代码,以前用的是http://wpa.qq.com/msgrd?V=1&Uin==*********&Site=&Menu=yes

◆要说明它的工作原理还要细谈微软关于注册应用程序协议的说明 Registering an Application to a URL Protocol

微软官方说明:http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/pluggable/overview/appendix_a.asp

此文中对于 Windows、Linux 和 OS X 操作系统如何注册协议都有说明。比如说 Windows,其实只需写入注册表,即可实现协议与执行程序的关联。

详细说明请参考:Register protocol

◆到这里我们再来剖析tencent://message/?uin=********的实现原理,腾讯的Tencent://Message协议注册表如下:

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

[HKEY_CLASSES_ROOT\TENCENT\DefaultIcon]
@=”D:\\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]
@="\"D:\\Program Files\\Tencent\\QQ\\bin\\Timwp.exe\"  \"%1\”"

此注册表所实现的就是当浏览器(或其它)碰到 tencent://… 时,自动调用 Timwp.exe,并把 tencent://… 地址作为第一个参数传递给 Timwp.exe。

◆腾讯又为广大网友推出一项新的服务Web presence,这项新服务可以不用登录QQ,只要把生成的代码嵌入到网页或是论坛上,代码会生成一个按钮,通过这个按扭就能看到你的QQ是否在线,同时更绝的是只要点击这个按扭,还可以给QQ发送消息,即使没有加好友,也可以自如的聊天,这是它的官方登入网页http://is.qq.com/webpresence,有兴趣的朋友可以在网页试验如下代码中Q我。

[img]http://wpa.qq.com/pa?p=1:1103150:13[/img]

[url=http://wpa.qq.com/msgrd?V=1&Uin=744014863&Site=yrj9814.blog.163.com&Menu=yes]有事点这里给我qq留言[/url]

同样可以在地址栏输入http://wpa.qq.com/msgrd?V=1&Uin=744014863&Site=yrj9814.blog.163.com&Menu=yes  Q我(这里site=连接到的网页,也可以自定义)

◆当然了解了微软协议的知识,也可以动手自定义协议,以下借鉴网友的自定义的HelloWorld协议来实现发送消息,注册表信息如下:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\HelloWorld]
@="HelloWorld Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\HelloWorld\DefaultIcon]
@="D:\\My Documents\\Visual Studio 2005\\Projects\\HelloWorld\\release\\HelloWorld.exe,1"
[HKEY_CLASSES_ROOT\HelloWorld\shell]
@=""
[HKEY_CLASSES_ROOT\HelloWorld\shell\open]
@=""
[HKEY_CLASSES_ROOT\HelloWorld\shell\open\command]
@="\"D:\\My Documents\\Visual Studio 2005\\Projects\\HelloWorld\\release\\HelloWorld.exe\" \"%1\"

(源代码下载:http://files.cnblogs.com/phinecos/HelloWorldProtocal.rar)

★★★★★★★★★★★★★★★★★以下提供几种QQ风格代码★★★★★★★★★★★★★★★★★★★★★

风格1 在线状态: http://is.qq.com/webpresence/images/status/01_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/01_offline.gif[*/img] 
风格2 在线状态: http://is.qq.com/webpresence/images/status/02_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/02_offline.gif[*/img]  
风格3 在线状态: http://is.qq.com/webpresence/images/status/03_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/03_offline.gif[*/img]  
风格4 在线状态: http://is.qq.com/webpresence/images/status/04_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/04_offline.gif[*/img]  
风格5 在线状态: http://is.qq.com/webpresence/images/status/05_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/05_offline.gif[*/img]  
风格6 在线状态: http://is.qq.com/webpresence/images/status/6_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/6_offline.gif[*/img]  
风格7 在线状态: http://is.qq.com/webpresence/images/status/7_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/7_offline.gif[*/img]  
风格8 在线状态: http://is.qq.com/webpresence/images/status/8_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/9_offline.gif[*/img] 
风格9 在线状态: http://is.qq.com/webpresence/images/status/9_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/9_offline.gif[*/img] 
风格10 在线状态: http://is.qq.com/webpresence/images/status/10_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/10_offline.gif[*/img]  
风格11 在线状态: http://is.qq.com/webpresence/images/status/11_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/11_offline.gif[*/img]  
风格12 在线状态: http://is.qq.com/webpresence/images/status/12_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/12_offline.gif[*/img]  
风格13 在线状态: http://is.qq.com/webpresence/images/status/13_online.gif[*/img]离线状态: http://is.qq.com/webpresence/images/status/13_offline.gif[*/img]

图片 地址
http://is.qq.com/webpresence/images/status/05_online.gif
http://is.qq.com/webpresence/images/status/6_online.gif
http://is.qq.com/webpresence/images/status/7_online.gif
http://is.qq.com/webpresence/images/status/05_offline.gif
http://is.qq.com/webpresence/images/status/6_offline.gif
http://is.qq.com/webpresence/images/status/7_offline.gif
http://is.qq.com/webpresence/images/status/8_online.gif
http://is.qq.com/webpresence/images/status/8_offline.gif
http://is.qq.com/webpresence/images/status/9_online.gif
http://is.qq.com/webpresence/images/status/10_online.gif
http://is.qq.com/webpresence/images/status/11_offline.gif
http://is.qq.com/webpresence/images/status/11_online.gif
http://is.qq.com/webpresence/images/status/12_offline.gif
http://is.qq.com/webpresence/images/status/12_online.gif
http://is.qq.com/webpresence/images/status/04_online.gif
http://is.qq.com/webpresence/images/status/04_offline.gif
http://is.qq.com/webpresence/images/status/13_offline.gif
http://is.qq.com/webpresence/images/status/13_online.gif

登陆你的QQ空间后点自定义(快捷键Ctrl+j,Alt+j)点新建模块→大图模块→输入或者粘贴刚复制的地址。然后点“更多设置”,点开之后下面有个显示边框,点“不显示”。上面有个图片连接地址输入:

tencent://message/?uin=*****&Site=www.qqkj.cn&Menu=yes

把上面地址中的*****改成你的qq号码,最后提交就可以了!

以上的只是本人的浅解,参考资料:

1、Registering an Application to a URL Protocol

2、Register protocol

3、仿腾讯 QQ 和 Skype 通过URL触发自己的程序

4、由Tencent://Message协议想到的一个解决方案

 
from:http://blog.csdn.net/zanfeng/article/details/37915111

tencent://message协议的更多相关文章

  1. Tencent://Message/协议的实现原理

    腾讯官方通过 Tencent://Message/协议可以让QQ用户显示QQ/TM的在线状态发布在互联网上:并且点击 XXX  ,不用加好友也可以聊天 官方链接: http://is.qq.com/w ...

  2. 由Tencent://Message协议想到的一个解决方案

    参考网址:http://www.cnblogs.com/phinecos/archive/2009/03/06/1404951.html 源代码下载:http://files.cnblogs.com/ ...

  3. [转]由Tencent://Message协议想到的一个解决方案

    源代码下载:http://files.cnblogs.com/phinecos/HelloWorldProtocal.rar 前天在BruceZhang的一篇博文<求助:如何在ASP页面中调用W ...

  4. Tencent://Message/协议的实现原理(Windows提供协议注册)

    腾讯官方通过 Tencent://Message/协议可以让QQ用户显示QQ/TM的在线状态发布在互联网上:并且点击 XXX  ,不用加好友也可以聊天 官方链接: http://is.qq.com/w ...

  5. [转]关于新一轮QQ Tencent://Message 在线联系

    关于在线QQ代码. 以前的QQ代码都需要添加好友. 现在的 首先是到http://wp.qq.com/生成你的QQ在线代码 很长的一段代码,并且每个QQ生成的sigT字符串都是不一样的.. 闲来无事, ...

  6. QQ网页链接打开本地QQ.exe原理

    一.观察现象 QQ推广上有相关文档 http://shang.qq.com/v3/widget.html 新建一个html,点击链接就会启动本地QQ. <html> <body> ...

  7. 使用tencent协议发起临时会话

    调用默认浏览器打开链接tencent://message/?uin=QQ即可发起临时会话参数uin为目标QQ Java示例 import java.awt.Desktop; import java.n ...

  8. 因特网服务的类型(协议),目前最流行的类型是 http协议

    在学习超链接中,在HTML上点击QQ图标时会 自动的启动自己本地QQ客户端,其方法是使用了超链协议 一些常用协议如下: file资源是本地计算机上的文件.格式file:/// ftp通过 FTP访问资 ...

  9. 在IE中启动火狐——自定义浏览器链接协议

    有时候需求就是这么奇葩,特别是在这个浏览器混战收尾的节骨眼上,有的客户正在将全单位的浏览器统一到Chrome.有的正在统一到Firefox.还有的正在统一到360上.于是就有了如题的需求,客户正在将浏 ...

随机推荐

  1. HTML中动态图片切换JQuery实现

    相信很多同学都注意到了,各大新闻或者娱乐网站都含有动态图片切换,那个漂亮的感觉让刚刚学习html的人,都非常好奇和心动.那下面就让我们看一下到底如何实现动态图片切换呢?看一下百度贴吧的效果图吧~ // ...

  2. php数组函数序列之array_unshift() 在数组开头插入一个或多个元素

    array_unshift() 函数在数组开头插入一个或多个元素.被加上的元素作为一个整体添加,这些元素在数组中的顺序和在参数中的顺序一样 array_unshift()定义和用法 array_uns ...

  3. 【转】Cygwin访问Windows驱动器

    From:http://www.cygwin.cn/site/info/show.php?IID=1000 由于自己的项目需要使用Linux内核,所以自己在windows下安装了一个Linux虚拟机! ...

  4. 欧拉工程第63题:Powerful digit counts

    题目链接 The 5-digit number, 16807=75, is also a fifth power. Similarly, the 9-digit number, 134217728=8 ...

  5. asp.net中runat="server"的含义

    aspx运行时会被编译,其中没有runat server属性的html标签会被直接写入response,有runat server属性的html标签会转换成对应的HtmlControl子类加入 到页面 ...

  6. stringUtils是apache下的Java jar补充包

    org.apache.commons.lang.StringUtils StringUtils中一共有130多个方法,并且都是static的, 所以我们可以这样调用StringUtils.xxx().

  7. java io异步

    1.一般来说,可以通过多线程的方式来实现异步 2.同步和异步着重点在于多个任务的执行过程中,一个任务的执行是否会导致整个流程的暂时等待: 3.而阻塞和非阻塞着重点在于发出一个请求操作时,如果进行操作的 ...

  8. HTML5入门3---视频播放器

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta na ...

  9. Mahout学习之Mahout简介、安装、配置、入门程序测试

    一.Mahout简介 查了Mahout的中文意思——驭象的人,再看看Mahout的logo,好吧,想和小黄象happy地玩耍,得顺便陪陪这位驭象人耍耍了... 附logo: (就是他,骑在象头上的那个 ...

  10. 3、JPA一些常用的注解

    常用注解有下面这些: ①:@Entity.@Table.@Id.@GeneratedValue.@Column.@Basic ②:@Transient 用于忽略某个属性,而不对该属性进行持久化操作 ③ ...