Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys! I made a working application that makes auto clicks on given coordinates and works well. But, when I open other applications my mouse moves to the coordinate and makes the click.
Is there any way to make my click not to interfere with other windows?( just click within my own application only)
Posted

1 solution

The only way that's going to happen is if your target application is sitting on top of all others. If your app is being covered up it doesn't have the input focus anymore so the mouse clicks will go to whatever window happens to be at the coordinates you provided.
 
Share this answer
 
Comments
Chriscs7 30-Aug-12 14:03pm    
Thanks for the reply, but how can I make my application to stay always on top?
Dave Kreskowiak 30-Aug-12 17:05pm    
Did you happen to see the TopMost property of your Form??

Don't use this in a production application. TopMost only applies until another application sets one of its windows as TopMost. Last one to do it wins.
Chriscs7 30-Aug-12 17:20pm    
Well then how can I solve my problem? If another application opens a new windows and I still want to click my app, how can this be done?
Dave Kreskowiak 30-Aug-12 21:18pm    
Simulating keyboard and mouse actions is not a viable way of controlling another application to perform some process.

It's OK to use for something like automated application testing, where nobody else is interfering what's happening with their own keyboard and mouse moves, or as a simluated input device, like an on screen keyboard. The application focus doesn't matter when using these.

You are trying to control a specific app using methods for which they were not designed.

I have no idea what the point is for even writing this application so it's impossible to tell you anything useful.

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