Jump to content
Sign in to follow this  
flyfisher

reference multiple windows for the same program

Recommended Posts

flyfisher

I am writing a script for a program. I will have 2 windows open for this program and need to refer to them individually. Since they belong to the same program, they all have the same title. Is it possible to name the windows in AutoIt when I run the program?

Any solutions is appreciated.

Share this post


Link to post
Share on other sites
flip209

Look that the control functions... au3info will help also...


" I haven't failed. I've just found 10,000 ways that won't work." Thomas Edison "You cannot help men permanently by doing for them what they could and should do for themselves." Abraham Lincoln

Share this post


Link to post
Share on other sites
covaks

WinSetTitle(). Also, you can refer to them by window handle after that, much easier.

opt("WinTitleMatchMode",4)

Run("Notepad")
WinWaitActive("Untitled - Notepad")
$hWnd1 = WinGetHandle("active")
WinSetTitle($hWnd1,"","Notepad One")


Run("Notepad")
WinWaitActive("Untitled - Notepad")
$hWnd2 = WinGetHandle("active")
WinSetTitle($hWnd2,"","Notepad Two")

msgbox(0,"","Moving window one")
WinMove($hWnd1,"",5,5,300,200)

msgbox(0,"","Moving window two")
WinMove($hWnd2,"",5,400,300,200)

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  

×