Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Visual-Studio VB.NET
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 29-Aug-12 12:51pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Chriscs7 at 30-Aug-12 14:03pm
   
Thanks for the reply, but how can I make my application to stay always on top?
Dave Kreskowiak at 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 at 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 at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.140709.1 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid