Shoutbox

Ambitious new plugin - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Ambitious new plugin (/showthread.php?tid=50577)

Ambitious new plugin by bigmog on 09-16-2005 at 04:20 PM

Guys

I'm writing a new plugin. I've manged to get the api working and can trap events and all that stuff. I'm doing it in C++ and I'm fairly happy with COM.

My plugin needs to trap inbound and outbound messages (this is easy) and also manipulate the text entry and main chat windows. I see how it is easy to get an IDispatch pointer back from OnIMWindowCreated but this doesn't really let me get at the richedit control of either the typed message or the chat window. Does anybody know how to get a COM pointer to these windows or even a HWND to the rich edit window (which I assume it is).

In my plugin I intend to add a whole range of rich tags like animated smiley's, sound clips and files, even video perhaps. To send these the user will send tags to the person they are chatting. If they don't have the plugin the tag will tell them how to install it. If they do have the plugin they will see the rich content. I may well be missing somthing obvious however.

I notice Pichou seems to hook the richedit dll because he has a dll in his distribution called RichEdHook.dll. He doesn't however expose any of this in his API that I can see.

Any help would be much appreciated. I even have a small budget to pay people if anybody is interested.


RE: Ambitious new plugin by RaceProUK on 09-16-2005 at 04:36 PM

Patchou doesn't expose the messages sent for reasons I can't remember ATM. However, you can still get the text by using the Active Accessibility API.


RE: Ambitious new plugin by bigmog on 09-16-2005 at 05:32 PM

I'll check out the Active Accessibility API in more detail - I guess my real stumbling block is working out how to manipulate the rich text area to put animaged gifs in there and other rich content.

Maybe that's not possible but there probably is a way!

Bigmog!


RE: Ambitious new plugin by Concord Dawn on 09-16-2005 at 06:09 PM

quote:
Originally posted by bigmog
I'll check out the Active Accessibility API in more detail - I guess my real stumbling block is working out how to manipulate the rich text area to put animaged gifs in there and other rich content.

Maybe that's not possible but there probably is a way!

Bigmog!

AFAIK it's possible, look at emoticons and custom emoticons.
RE: Ambitious new plugin by Yousef on 09-16-2005 at 08:34 PM

quote:
Originally posted by Concord Dawn
I guess my real stumbling block is working out how to manipulate the rich text area to put animaged gifs in there and other rich content.
I could help you with that when you're at that point... http://shoutbox.menthix.net/showthread.php?tid=49...d=520686#pid520686
RE: Ambitious new plugin by bigmog on 09-17-2005 at 07:49 AM


Thanks Juzzi - so do you know how to get at the message windows and put custom annimated gifs (emoticons) in them and also sound clips. I want to put a whole new set of emoticons in there but if the person receiving the emoticon doesn't have my plguin I want to display a link to the plugin instead!

If you are prepared to help me with this that would be great!


RE: Ambitious new plugin by Yousef on 09-17-2005 at 08:40 AM

I can help you when you've fixed the first problem, obtaining a handle to the richedits. Then I can help you with inserting pictures etc.


RE: Ambitious new plugin by Dempsey on 09-17-2005 at 10:14 AM

quote:
Originally posted by Juzzi
I can help you when you've fixed the first problem, obtaining a handle to the richedits. Then I can help you with inserting pictures etc.
MSN Chat windows use a windowless richedit control, so i dont think you can get a handle to them.  The way Patchou adds text to it is by hooking the creation of the control and getting a pointer to the ITextServices if i remember correctly.
RE: Ambitious new plugin by RaceProUK on 09-17-2005 at 11:21 AM

If you can get an ITextServices via Active Accessibility, please let us know, as both me and Demps will like such info.


RE: Ambitious new plugin by bigmog on 09-17-2005 at 02:54 PM

Yep I think one method to get a ITextServices is using COM hooking as described in http://www.thecodeproject.com/com/cominterfacehoo...xp=0&select=787796. However it might also be possible with Active Accessibility I'm going to check that out as it would be better to do it this way if it is.


RE: Ambitious new plugin by Dempsey on 09-17-2005 at 02:57 PM

from what i've used of the Active Accesability APIs I wouldn't have thought it's possible using them, although I could be wrong...


RE: Ambitious new plugin by Patchou on 09-17-2005 at 05:29 PM

Note for those interested.... Messenger Plus! substitutes the RichEdit DLL for its own to intercept API calls and get interfaces such as ITextServices. This is not very difficult to do, however, editing the text of a chat is more complicated than it appears because of many elements such as emoticons whose positions are caluclated differently by Messenger.


RE: Ambitious new plugin by bigmog on 09-17-2005 at 08:41 PM

Hi Patchou

Would you consider making these interfaces available in to us mortals so we can use them in our plugins? I for one would really find that very useful. I think it would make it much easier for us to write great plugins which in turn would increase Messenger plus's distribution base.

Any help would be most appreciated.


RE: Ambitious new plugin by bigmog on 09-19-2005 at 03:35 PM

OK guys just a quick update here. It seems that what Patchou does and others is use a hook on LoadLibrary and intercept the loading of richedit20.dll. I've also seem a more crude attempt where a dummy version of richedit20.dll is placed in the messenger directory.

Either way results in the ability to intercept the call to CreateTextServices which gets back an IUnknown. Query interface on this IUnknown can give you an interface to ITextServices. 

What we can do is just pass through the ITextServices pointer back to messenger but remember its address and re-write its VTable so that calls to ITextServices::TxSendMessage for example are routed though our code. This then is very similar to MessageHooking as we can intercept messages as they go to the rich text edit control.

I'm going to code all this up and hopefully post it to the thread so we all have access to this trick.

Any help again most welcome and if people out there who have done this know I'm not on the right lines can they please let me know!


RE: Ambitious new plugin by eSouL on 10-06-2005 at 06:54 AM

Hi, any updates on this trick?

I'm planning to do an encryption plugin. But unlike Stupido's  K-crypt, I want the text displayed on the sender's richedit control to be legible text (although the actual msg is sent as ciphertext). Is the discussion on this thread relevant to my project, or is there another way to do it?

Thanks in advance!


RE: Ambitious new plugin by bigmog on 10-06-2005 at 07:07 AM

Hi Everyone

Some updates news on this one. I've managed to write a plugin dll in C++ to get at the rich text area. It was quite hard took four weeks full time programming.

I can insert Ole controls into the text area and intercept each key pressed etc. change all the formatting etc.

The code is still a bit buggy but when it's tidied up I'll post it online.


RE: RE: Ambitious new plugin by Londave on 11-29-2005 at 08:24 AM

quote:
Originally posted by bigmog

Some updates news on this one. I've managed to write a plugin dll in C++ to get at the rich text area. It was quite hard took four weeks full time programming.

I can insert Ole controls into the text area and intercept each key pressed etc. change all the formatting etc.

The code is still a bit buggy but when it's tidied up I'll post it online.


Can you post this code or send it to me (private). I can help you to debug and enhance your code.
RE: Ambitious new plugin by RaceProUK on 11-29-2005 at 01:06 PM

quote:
Originally posted by bigmog
Hi Everyone

Some updates news on this one. I've managed to write a plugin dll in C++ to get at the rich text area. It was quite hard took four weeks full time programming.

I can insert Ole controls into the text area and intercept each key pressed etc. change all the formatting etc.

The code is still a bit buggy but when it's tidied up I'll post it online.
Please, do post this code!