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).