What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)

Pages: (2): « First « 1 [ 2 ] Last »
[Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
Author: Message:
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
the only thing I'll say on this subject is: careful. Subclassing windows properly is something that takes time and anybody doing this kind of thing needs to make sure his code is tested extensively.

As for using GetCallbackPtr with SetWindowLong: don't. The documentation specifically mentions that this function can only be used for synchronous calls. If you make a script that defys this rule, it may work at first but the combination of several scripts will certainely cause unexpected results / crashes.

This post was edited on 03-28-2008 at 07:55 PM by Patchou.
[Image: signature2.gif]
03-28-2008 07:34 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
Isn't the reason you want to subclass something because you need to catch just a certain message? I don't see why you would want to catch all possible messages there are, that would be useless (unless you make a Windows Message Spying program).
Yes, but you have to send the messages you don't want back to the original windowproc. You can't do this with a Plus! window because you only have control over the messages you ask for.
But aren't all other messages already forwarded to the original WinProc by Plus!?

Though I know this wouldn't work in all situations either though, and it is a bit of a dirty method. But I think this might be possible for specific things

EDIT: Plus! doesn't know the original WinProc, that would of course be the reason, no?


quote:
Originally posted by Patchou
As for using GetCallbackPtr with SetWindowLong: don't. The documentation specifically mentions that this function can only be used for synchronous calls. If you make a script that defys this rule, it may work at first but the combination of several scripts will certainely cause unexpected results / crashes.
I know this would be a lot to ask, but can you explain this in more detail and/or with an example, as I like to understand in much detail why it would cause a crash/unexpected results in some cases.

EDIT: apparently not possible :'( Just had a quick chat with Patchou. In short:
quote:
Originally posted by Patchou
the problem is a technical limitation: for callbacks I dont have much other choice than using static functions in my code so I cant have two scripts using a callback at the same time, which is why they have to be synchronous.
...
Thus right now, calling GetCallbackPtr() many times, from different scripts, will always return the same pointer for a function with a given number of arguments.
...
Meaning two scripts can't subclass any two window at the same time. Even one single script wouldn't be able to subclass two windows with that method.
...
Now, he also gave a hint as in how it would be possible, but that involves asm (which _is_ possible in scripting, but extremely advanced).

This post was edited on 03-29-2008 at 04:24 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-29-2008 03:56 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
quote:
Originally posted by CookieRevised
EDIT: Plus! doesn't know the original WinProc, that would of course be the reason, no?
Yes, this is the reason. Plus! would call the default Windows message handler and the chat window's message handler would never see the messages.

quote:
Originally posted by CookieRevised
Now, he also gave a hint as in how it would be possible, but that involves asm (which _is_ possible in scripting, but extremely advanced).
It's very messy, but you can inject the ASM bytes of a new wndproc into memory and use a pointer to those. It's really better to just use a dll if you need to subclass.
03-29-2008 06:17 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
quote:
Originally posted by deAd
quote:
Originally posted by CookieRevised
Now, he also gave a hint as in how it would be possible, but that involves asm (which _is_ possible in scripting, but extremely advanced).
It's very messy, but you can inject the ASM bytes of a new wndproc into memory and use a pointer to those. It's really better to just use a dll if you need to subclass.
I know, hence why I said it is possible. I use ASM in one of my own private scripts... (which is not messy imo though, actually straightforward) ;)

This post was edited on 07-19-2008 at 08:11 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-29-2008 07:18 PM
Profile PM Find Quote Report
riahc4
Veteran Member
*****


Posts: 1073
Reputation: -18
– / Male / Flag
Joined: Aug 2004
Status: Away
RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
quote:
Originally posted by phalanxii
<snip>
Thanks for the resource. Even though SOMEONE has to bitch about the hard work you went thru to make a scripter's life easier, I for one appreciate your time and work/effort.

Also big thanks for "TabbedStatusIcon" but if its suppose to work like Veggie's Status Icon, it doesnt. At least not here:
Vista
Plus! 3.60
Messenger 9.0

This post was edited on 03-31-2008 at 01:48 AM by WDZ.
03-31-2008 12:59 AM
Profile PM Find Quote Report
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
O.P. RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
Well, I certainly have no idea about ASM, but for those who are interested, deAd has explained how to do it in this separate thread.

Anyway, I was browsing around MSDN and found this page explaining how to subclass windows.

It uses the SetWindowSubclass, RemoveWindowSubclass and DefSubclassProc functions from comctl32.dll which comes with Windows XP (?).

Is it possible to use these functions with GetCallbackPtr in order to subclass, or is there still the same problem as using SetWindowLong and GetCallbackPtr?

quote:
Originally posted by riahc4
Also big thanks for "TabbedStatusIcon" but if its suppose to work like Veggie's Status Icon, it doesnt. At least not here:
Vista
Plus! 3.60
Messenger 9.0
I'm using XP at the moment with Plus! 3.60, but I have had confirmation that it works on Vista too. I don't know whether it works on Messenger 9.0 though, but I see no reason why it shouldn't. Perhaps you need to restart messenger?
04-12-2008 12:44 AM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: [Resource] Subclassing ActiveXObjects (and [Release] TabbedStatusIcon too!)
quote:
Originally posted by riahc4
Also big thanks for "TabbedStatusIcon" but if its suppose to work like Veggie's Status Icon, it doesnt. At least not here:
Vista
Plus! 3.60
Messenger 9.0
you can't use 3.60 with 9.0 :P

what is the difference in this script and the Status Icon script?
[quote]
Ultimatess6
: What a noob mod
04-12-2008 02:13 AM
Profile PM Web Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On