How can i subclass an external application like calc?
Printable View
How can i subclass an external application like calc?
I think you can only subclass apps that are set up to be so, as active x objects. Why would you need to sublcass the Calculator? Why not just do the calculations in VB? If you mean just starting it from within your program then you can just Shell or ShellExecute.
I've been trying to do the same thing for a long time. You can subclass within your own thread, but when you look at an external app, the AddressOf operator with VB isn't enough. You need C++ or a third-party tool such as Spyworks. Hope this changes in vb7.
I don't need to subclass the calc, it was just an example.
What i realy need to do is to click a dynamic menu of an external application and i thought that if i subclass it and see what msg send that menu i will be able to send that msg to tha app and click it.
Thanks anyway
PD: WadeD i see arround ther that you have a dll in c that do something like what i want
can you give it to me or help me doing that??
If you get the MenuID, you can use SendMessage without looking up the message.
WadeD:
yes i try that but the getmenu doesn't work
it seem to be a menu created at runtime or something like that
it is a right click menu
Controls are windows also. If you can get the handle to one of the controls used to get the pop-up menu and use that as the window handle for GetMenu, you should be able to get the menu handle.
I just try it but doesn't work
I think that the menu is created in the instant that i right click program.
So i think that the only way is to see the message of that menu and send it.
I'm using Desaware Spyworks (from the guy who wrote the VB Programmer's guide to API - Dan Appleman) which uses a dll in c++. But that's because I need to intercept certain messages while the user is in that process. For your purpose, you just need to capture the message once. Try Spy++ that comes on the VB cd. Then you can use SendMessage.
HI guys,
I Use a free subclasing control from softcircuits programming.(http://www.softcircuits.com).
It is really free and pretty easy to use. The package also
includes 8 demonstration of the control.
Now go get it .. .
ftp://ftp.softcircuits.com/vbsrc/subcls32.zip
----
WadeD: can you send me that Desaware Spyworks to try if it works please.
Antonio, it's an entire CD. Check it out at Desaware.