How can i subclass an external application like calc?
Printable View
How can i subclass an external application like calc?
Learn C++, you just can't do it in Pure VB, I had a damned good go at doing it in VB but you just Can't.
Actually, Sam, you can...but by the time it works, you've used so much of the API that it looks like C++.
Antonio: why d'you need to subclass calc? There are considerably better freeware calculators with source code available...unfortunately they're likely to be in C++, so I agree with Sam.
PS: I use C++ most of the time, and then VB for building nice UIs.
I am not too sure what this is, but I know its not possible with pure VB(meaning no API whatsoever), you have to use API.
by the way , what is subclassing?
please explain..
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
To find out what message a menu item sends is easy, and you don't need any subclassing. Use Spy++ to spy on the window's messages and see what parameters are sent with the menu's WM_COMMAND message.
By 'dynamic menu', I have a feeling you mean popup menu. Popup menus aren't necessarily dynamic - in fact, most are *NOT* - they just get activated differently. However, be warned: if the app uses the TPM_RETURNCMD flag when it calls TrackPopupMenu to show the menu, you'll never be able to fool it.