Jump to content

reference multiple windows for the same program


Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...