|
-
Aug 10th, 2006, 05:19 AM
#1
Thread Starter
Lively Member
Listen for button click
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!
-
Aug 10th, 2006, 06:11 AM
#2
Re: Listen for button click
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.
-
Aug 10th, 2006, 06:17 AM
#3
Thread Starter
Lively Member
Re: Listen for button click
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.
-
Aug 10th, 2006, 06:34 AM
#4
Re: Listen for button click
<Went away to the API forum>
Yes, that's the two subclassing examples I mentioned above.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|