Jump to content
Sign in to follow this  
BeMa

Automating .Net application

Recommended Posts

BeMa

Hi,

forumsearch und reading the FAQ did not give me an idea how to automate .Net applications created with Visual Studio.

The problem is, that in these programs the identifieres for the controls (ControlID and ClassName) are only temporary valid. They get changed either every times the application starts or when I move to another PC.

Does anybody has an idea how to automate such applications?

Using of xy-koordinates and sendkey with tab is not convinient.

Regards

Bernhard

Share this post


Link to post
Share on other sites
seandisanti

Hi,

forumsearch und reading the FAQ did not give me an idea how to automate .Net applications created with Visual Studio.

The problem is, that in these programs the identifieres for the controls (ControlID and ClassName) are only temporary valid. They get changed either every times the application starts or when I move to another PC.

Does anybody has an idea how to automate such applications?

Using of xy-koordinates and sendkey with tab is not convinient.

Regards

Bernhard

well if you can't controlsend() and controlclick() that leaves send() and mouseclick(). as inconvenient as it may be, if that's the only way to do it, you may have to do it that way. Now i do understand that window positions and sizes change, and that can always be a problem, but you do have options to remove some of your environment variables. The easiest thing to do would be to explicitly set the window size and position with your script, so then you have exact coordinates for each of the controls you want to access. If you're worried about people complaining that they can't move their window around etc, then i'd suggest using math to dynamically figure where to click each time. example:

$pos = wingetpos("Your App")
MouseClick("Left",$pos[0] + 200,$pos[1] + 20,1,0)

Share this post


Link to post
Share on other sites
MHz

Forget the math. Just work within the window area.

Opt("MouseCoordMode", 0)

Share this post


Link to post
Share on other sites
LxP

The _ControlGetHandleByPos() UDF has proven to be useful in the past when working with .NET applications.

P.S. Welcome to the forums!

Edited by LxP

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×