In almost every samples of subclassing solves how to subclass your own application. But I am not able to subclass any window (through handle) and I don't know where is the problem. Can somebody help me to subclass another window (like Spy++)?
Printable View
In almost every samples of subclassing solves how to subclass your own application. But I am not able to subclass any window (through handle) and I don't know where is the problem. Can somebody help me to subclass another window (like Spy++)?
I dont have the code anymore, but I once used an example found on here(vb-world) and modified it to catch all clicks for internet explorer.
it worked fine, you just replace the hwnd of your form, with the hwnd of the window you want to subclass.
I tried it once and it didn't work :(
In order to Subclass windows that aren't yours you must use a callback function that is located in an external DLL.
You can't create this kind of DLLs in VB though.
Make sure that it's a Standard DLL, not an ActiveX DLL. To create standard DLL's, use Visual C++ because VB can only create OLE DLL's.
damn, must have been dreaming then...Quote:
Originally posted by Sc0rp
I tried it once and it didn't work :(
In order to Subclass windows that aren't yours you must use a callback function that is located in an external DLL.
You can't create this kind of DLLs in VB though.
I hate that... dreams seem so real.
denniswrenn: ???
Dennis: Are you sure you didn't use a DLL for it?
oh yeah, I think I used a DLL......
I dont have it anymore ... it was on my HDD before I reformatted....
Ain't that convenient?
Is there a way to Subclass windows using CopyMemory in some way?
I mean SetWindowLong sets the value of the proc in the memory, doesn't it?
With SetWindowLong you provide a pointer to the function (this is what AddressOf gets). I think using FindWindow and SetWindowLong should be able to get it sorted. On the other hand, you could set a global hook, in which case it's easier to use a DLL.
And Windows doesn't have a DLL file which could call my function?