I am looking for a method to get a button press event, something similar like this which is used to retrieve a pointer right after an event is fired. The button I mean is located on any particular windows application I set as a target (.eg windows media player's Play button). If you know what message to catch right after I click the Play button.
What you are looking for is Global Mouse Hook. You can take a look at this article: Processing Global Mouse and Keyboard Hooks in C#
Once you handle CLICK event, you can use API functions to get Application / Control under the cursor (WindowFromPoint).
Here is one more article with code sample that will help you: .NET Object Spy and InvokeRemote (this is similar to spy++)
You cannot do this without using windows native methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With