首先对标题说明一下,在msn中,聊天的窗口可能是一个自定义的类。大家用spy ++可以看看。对与自定义窗口,可以使用createwindow, setwindowlong或者是subclasswindow实现,不过这不是我现在讨论的话题。
好, 先看看效果再说:
关于这个的实现。我们首先应该明了,我们必须实现一个ole对象。而且这个对象能够播放gif.对于播放gif,代码已经很多了。
有了这个就完了么?当然不是。你还有写一个ole/com对象。实现ioleobject等。你是用atl还是mfc呢?我什么也没有用。在这个目录下%program file%\tencent\qq\,你可以看到一个imageole.dll,她就是你日夜思念的人!
好吧,让我们来看看他的真面目。怎么看?x ray? 当然不是——ole/com viewer.click on “all objects”,view typelib... 打开那个文件,你可以看到:
[
uuid(0c1cf2df-05a3-4fef-8cd4-f5cfc4355a16),
helpstring("igifanimator interface"),
dual,
nonextensible
]
dispinterface igifanimator {
properties:
methods:
[id(0x00000001), helpstring("method loadfromfile")]
void loadfromfile([in] bstr filename);
[id(0x00000002), helpstring("method triggerframechange")]
variant_bool triggerframechange();
[id(0x00000003), helpstring("method getfilepath")]
bstr getfilepath();
[id(0x00000004), helpstring("method showtext")]
void showtext([in] bstr text);
};
#import "d:\\program files\\tencent\\qq\\imageole.dll" named_guids
named_guids 表示让编译器为我把对应库的guid和声明对应起来。我们就可以用clsid_gifanimator引用对应的接口了。不用那一长串的东西。然后它就会为我们生成两个文件。Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器