Sign in to follow this  
Followers 0
Jake657

How to identify a frame with a random Instance number?

5 posts in this topic

Hi

I'm trying to create an AutoIt script that will interact with an application. I have successfully used AutoIt before to create scripts for web page but I'm really struggling to get started with this one for an application.

After the app has opened and I manually choose a few options it then opens some frames which I want AutoIT to work with - but I can't figure out how to identify these frames.

The window info tool tells me that the Class for these frames is WindowsForms10.window.8.app.0.378734a

and the Instance is a randon 2 or 3 digit number - each time a new frame is created the Instance number changes

Could somebody tell me how to identify to AutoIT the frame I want to work with?

Thanks very much and sorry if this is a very basic question.

--

Jake

Share this post


Link to post
Share on other sites



If you know the title or part of the title, maybe you can try Winexists with "Advanced Window Descriptions"? Something like

WinExists("[REGEXPTITLE:WindowTitleHere ; CLASS:WindowsForms10.window.8.app.0.378734a;]")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I tried this ...

if WinExists("[REGEXPTITLE:WinTrader 4.5 ; CLASS:WindowsForms10.window.8.app.0.378734a;]") Then
    MsgBox(0, "", "Window exists")
EndIf

but it didn't work. The MsgBox didn't appear.

How would this help me anyway? I don't understand how this would identify which frame in the Window I want to work with.

Thanks for the help, it's much appreciated.

Edited by Jake657

Share this post


Link to post
Share on other sites

Ah! I found my typo!

OK it works now but how does this help? WinExists confirms that the frame is there - how can I work with this frame without knowing its name/ID ?

Share this post


Link to post
Share on other sites

Ah... from the titel of the window I see someone else has the same Ideas as I have :)

Try something like

$hWnd = WinGetHandle("[REGEXPTITLE:WinTrader 4.5 ; CLASS:WindowsForms10.window.8.app.0.378734a;]")

ControlSend($hWnd, "", "Edit1", "AbCdE")

... and don't miss the _sqlite functions in the UDF for storing "important" information :)

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