Jump to content

Recommended Posts

Posted

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?

Posted

Hi,

Each window has a handle which is unique, you can do a WinList with a title then keep the handles when you have differentiated the windows.

Br, FireFox.

Posted

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

Posted

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)

Posted (edited)

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
Posted

If it is possible use a hidden label and search for this text in a loop of Winlist.

Then get hwnd of the win you want to identify.

Greetings

Adom

Thanks! :bye:

Greetings

Andrew

 

Posted

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

Posted

hm. The only way for you to differentiate them is to read their text using the ControlGetText function (use the Au3Info tool for that).

Br, FireFox.

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
×
×
  • Create New...