Sign in to follow this  
Followers 0
russell

Reffrece diffrent windows with the same title

7 posts in this topic

I was wondering and this may be impossible. But can autoit reference 1 window if lets say there where two open that have the same title. Like can it open one and give it a note or rename the title to use as a reference to disguise a difference from the second?


muppet hands are so soft :)

Share this post


Link to post
Share on other sites



I found that the Autoit WIndow Info tool has the two instances as diffrent handles, How would you use that in a script? WOuld you say like WinActive $Window1 and have $window1 equal the handle? Im a little lost on that


muppet hands are so soft :)

Share this post


Link to post
Share on other sites

Ok using the handle works lol i may have this solved before anyone reply s. Next question.....the handle seems to change each time i close the windows ans reopen. Is there a way to set a windows to a handle or have it grab the handle upon opening and plug into the script?


muppet hands are so soft :)

Share this post


Link to post
Share on other sites

Alright got that done, little off but hmmm is there a way to get the handle of the active window?


muppet hands are so soft :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sleep(5000)
AutoItSetOption("WinTitleMatchMode", 4)
$handle = WinGetHandle("")

If @error Then
    MsgBox(4096, "Error", "Could not find the correct window")
Else
Sleep (1000)
WinMove($handle, "", 0, 0, 1030, 793)
MsgBox(4096, "Test", $handle, 54)
EndIf

only returns 0x00000000 and doesn't resize. Am im doing something wrong?

When i use the Window info tool it says the Handle is "0x0000000000D03DA

Edited by russell

muppet hands are so soft :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You seem to be having a good conversation with yourself. Given enough time I think you'll be able to figure out that Unified Theory thing...in you code, your are not passing Title/Class/Instance/Coordinates/Text to your WinGetHandle function. That's a good reason why it cannot find your window and handle. You'll need to pass something to it to differentiate between all the existing windows on your OS. If the title is blank, you can pass any combination of the Class/Instance/Coordinates/Text to narrow down your results.

EDIT: You can also specify the Active window

WinGetHandle("[ACTIVE]")
Edited by Varian

Share this post


Link to post
Share on other sites

You seem to be having a good conversation with yourself. Given enough time I think you'll be able to figure out that Unified Theory thing...in you code, your are not passing Title/Class/Instance/Coordinates/Text to your WinGetHandle function. That's a good reason why it cannot find your window and handle. You'll need to pass something to it to differentiate between all the existing windows on your OS. If the title is blank, you can pass any combination of the Class/Instance/Coordinates/Text to narrow down your results.

EDIT: You can also specify the Active window

WinGetHandle("[ACTIVE]")

Ok this sounds like its working in the direction i need. Labeling [Active] seem to have done it. Thank you and thank myself. I think lol jk

muppet hands are so soft :)

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