Click here to Skip to main content
15,891,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.

I am wondering if there is a possible way to get click event from a third party app using Windows API.
The app is Team Viewer. When I click on connect to detect it with my C# code.

Please respond.
Posted
Updated 1-Dec-15 0:45am
v2

There is no way to subscribe to that "event" in the traditional .NET sense.

It's probably possible to do using the Accessibility functions in Windows. Start reading up on that here[^].
 
Share this answer
 
In theory, you can use a Global Mouse Hook in C#: there are numerous articles on implementing Global Hook here on CodeProject, like the "classic" article by George Mamaladze that has been improved over many years: [^]. George's work on this now continues here [^].

Well, yes, you can get a click on anything in your C# application; that's the good news; here's the possibly-less-than-good news: deciphering exactly what got the click may (or may not, depending on many possible factors) be tricky.

I would probably focus on detecting application start-up, rather than the user clicking some button in the app.
 
Share this answer
 
v2
Comments
Zhivko Kabaivanov 6-Dec-15 4:50am    
Thank you, I found that.
I can detect the start up of the app, but my solution is working for a specific behavior of that app.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900