Sign in to follow this  
Followers 0
BeMa

Automating .Net application

5 posts in this topic

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



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)

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Forget the math. Just work within the window area.

Opt("MouseCoordMode", 0)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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  
Followers 0