Cricheditctrl in MSNQQ (four) - Animation expression (Full Source Code)

xiaoxiao2021-03-06  67

Full Source Code Here: http://www.codeproject.com/ricedit/animatedemoticon.asp

First of all, a title indicate that in the MSN, the chat window may be a custom class. The big house can take a look at SPY . To achieve CreateWindow, SetWindowlong or SubclassWindow, this is not the topic I am discussing now. Ok, let's take a look at the effect first: The main thing I achieve is: (1) Font format; (b) hyperlink; (3) background picture; (4) animation expressions

About this implementation. We should first be clear, we must implement an OLE object. And this object can play GIF. For playing GIF, the code has been much. More famous is the GIF89A who encapsulates, is not bad, I like that cpictureex. You can find it at Vchelp. Is there this, is it? of course not. You still have to write an OLE / COM object. Implement IoleObject, etc. Are you using ATL or MFC? Oh, I am useless. In this directory% program file% / tencent / qq /, you can see an imageole.dll, she is your day and night miss! Ok, let's take a look at his true face. How to see? X ray? Of course not - opay / com viewer.click on "all objects", view typelib ... Open that file, you can see: [UUID (0C1CF2DF-05A3-4FEF-8CD4-F5CFC43555A16), 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 );}; This interface is what we want. You can test it with ActiveX Control Test Container. Still tube. So how do you use it in our program? I don't have so much time, give the code first, have time to say, forgive me. First we import imageole.dll1 # import "d: // program files //temnt // qq // imageole.dll" named_guids

Named_guids means that the compiler corresponds to the GUID and statement of the corresponding library. We can use the CLSID_GIFANIMATOR to reference the corresponding interface. No need for a long string. Then it will generate two files for us. ImageOle.tlh