Hi,
Is it possible to somehow listen (from VB code) if a button on some other application (not made by me) has been clicked? Probably with API functions? I suspect that maybe GetMessage could do it? Very grateful for help!
Printable View
Hi,
Is it possible to somehow listen (from VB code) if a button on some other application (not made by me) has been clicked? Probably with API functions? I suspect that maybe GetMessage could do it? Very grateful for help!
No, GetMessage retrieves a message from the calling thread, which means that it can only get messages from your own application.
To be able to listen to messages sent to a window or control you would need to subclass it. However VB itself doesn't allow subclassing of external programs, the simple reason for that is because such a callback function needs to exist in a regular DLL and you can't create on of those in VB, you'll need to use another language to be able to do that. However once you have a DLL that can do that you can use that from VB.
There is a couple of examples in the Code Bank, search for subclassing external application.
OK thanks Joacim...I have asked the question on the API forum too, and I got some code there to use...so I'll maybe try that later.
<Went away to the API forum>
Yes, that's the two subclassing examples I mentioned above.