Shoutbox

Hooking the Messenger Main Window - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Skype & Live Messenger (/forumdisplay.php?fid=10)
+----- Thread: Hooking the Messenger Main Window (/showthread.php?tid=49222)

Hooking the Messenger Main Window by RaceProUK on 08-20-2005 at 11:13 AM

I've tried the obvious (Windows CBT hook), but even the HCBT_ACTIVATE doesn't seem to be triggered when the contact list is shown. I know a CBT hook would work if I had an EXE running before Messenger, but I'm writing a plugin, so all windows have already been created.
I know TazDevil is at least able to manipulate the contact list window, so I was wondering how it's done? And if anyone else has any info as well.

Ultimately, I want to add a menu to the contact list window.


RE: Hooking the Messenger Main Window by Stigmata on 08-20-2005 at 11:40 AM

Ive done this before, and plus is what is stopping you..

Plus changes something.. cant remember what..

Kill msgplus.exe and it should work fine :P


RE: Hooking the Messenger Main Window by absorbation on 08-20-2005 at 11:42 AM

does'nt mdx now add the menu? well e-mail patchou would be the best way :)


RE: Hooking the Messenger Main Window by Dempsey on 08-20-2005 at 12:02 PM

TazDevil monitors windows created by the msnmsgr.exe process and then compares each window to the main window hwnd returned from the messenger api and if theres a match, its the main window so then you can do what you want with it.


RE: Hooking the Messenger Main Window by RaceProUK on 08-20-2005 at 12:32 PM

So I guess TazDevil uses some form of API hooking?


RE: Hooking the Messenger Main Window by Dempsey on 08-20-2005 at 12:34 PM

i assume so yes i'm not actually sure.  try pming him cos he's no online atm


RE: Hooking the Messenger Main Window by RaceProUK on 08-24-2005 at 02:32 PM

Strange no-one else has posted anything yet.


RE: Hooking the Messenger Main Window by TazDevil on 08-24-2005 at 04:24 PM

Hi Dempsey just pm'ed me about this issue...

First of all i tryed the CBT hook as well and had the same problem with raceprouk with HCBT_CREATED... because the plugin was loaded after the conctact list was created, so it was useless...

Then i used the HCBT_ACTIVATE hook whick worked ok, but still there is a catch here as you subclass the window before Plus! does and there i had a problem with transparency (cause i am removing the menu)... so there is no good as well

From my reaserch after trying to resolve the transparency issue i had to subclass the window after Plus does, so i had to make sure that at least the plus menu is loaded in the contactlist window...

I have also tryed other hook types such as WH_WNDPROC etc but still that was no good, so i decided to work with api hooking

So the latest place that i have come upto right now that doesnot give me a problem with the transparency is hooking the InsertMenuItem() API called by msgplush.dll not msnmsgr.exe

But then again if you are not removing the menu bar then at HCBT_ACTIVATE it should work fine.

I order to test for the contactlist hwnd compare it with the handle provided by the messenger API

hope it helps, if you need any more clarifications let me know


RE: Hooking the Messenger Main Window by RaceProUK on 08-24-2005 at 05:38 PM

Thanks Demps for PMing TazDevil, and thanks TazDevil for the info. I did have the hook looking for HCBT_ACTIVATE, but I was then doing stuff with window class names. Had I thought to compare HWNDs, I'd have sorted this problem already.
As for the menu thing, I plan to add to the menus, not remove them. Would adding menus pose a problem, like removing them?


RE: Hooking the Messenger Main Window by TazDevil on 08-24-2005 at 05:48 PM

quote:
Originally posted by raceprouk
Thanks Demps for PMing TazDevil, and thanks TazDevil for the info. I did have the hook looking for HCBT_ACTIVATE, but I was then doing stuff with window class names. Had I thought to compare HWNDs, I'd have sorted this problem already.
As for the menu thing, I plan to add to the menus, not remove them. Would adding menus pose a problem, like removing them?
Happy to be of some help

No adding to the menu will not cause any problems, and it it quite easy to do as well you just GetMenu(hwnd) and just add menus with InsterMenuItem() etc, then catch WM_COMMAND messages sent/posted to the contact list window proc....

that is all about it :)
RE: Hooking the Messenger Main Window by RaceProUK on 08-24-2005 at 06:52 PM

I've done menu stuff before, in Phoenix 2 :P
But anyway, good to hear adding to the menus won't screw something up :D