Jump to content

Differentiate between 2 windows with same name/title


Recommended Posts

How do i  differentiate between 2 windows with same name/title ?

Though both have same name but content and processing fields is different.

And 1 of the window may not appear all the time while the script executes.

Tried with WinWaitActive ( "<title>" , " " , 1000 ), but not able to differentiate.

Any suggestions?

Link to comment
Share on other sites

hi sumitd

have you tryed to use the second parameter of the WinWaitActive() function?,
it is used to search a text inside the windows body instead of only the title

bye

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

hi Prodigy,

I tried with the text option in WinWaitActive() function, but it doesn't seem to differentiate.

FireFox,

how do I use WinList and the handle to differentiate between windows? (In my case 1 of the window may not appear all the time)

Link to comment
Share on other sites

I don't know what you mean by "not appear", if this mean hidden then try this :

Local $aWl = WinList("mytitle")
If $aWl[0][0] = 0 Then Exit 1

Local $hWndNotAlwaysVisible = 0

While 1
    For $i = 1 To $aWl[0][0]
        If IsVisible($aWl[$i][1]) = 0 Then
            $hWndNotAlwaysVisible = $aWl[$i][1]
            ExitLoop 2
        EndIf
    Next
    Sleep(10)
WEnd

WinSetState($hWndNotAlwaysVisible, "", @SW_SHOW)

Func IsVisible($hWnd)
    If BitAND(WinGetState($hWnd), 2) Then Return 1
    Return 0
EndFunc   ;==>IsVisible
Br, FireFox. Edited by FireFox
Link to comment
Share on other sites

Firefox,

The window is not hidden. What I meant was that the windows are a part of installation process and both window pop out if only a previous installation is detected,

else only 1 of the window appears in the installation process.

~sumitd

Link to comment
Share on other sites

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...