Magikarp7

How do I detect a new IE instance?

2 posts in this topic

Here is my code for one function:

Func Tracker() ; tracks if a new and similar IE window is opened.


    Global $StartUp = WinGetHandle("[Class:IEFrame;Title:FTD - Single Sign-On]")

    If $windowNumber = 0 And WinExists($StartUp) Then
            Local $winListT = WinList()
            $winIndexT = _ArrayFindAll($winListT,"Sign-On",Default,Default,Default,3,0)
            If UBound($winIndexT) = 2 Then
                $firstWdw = $winListT[$winIndexT[0]][1]
                $windowNumber =  $windowNumber + 1
;~                 MsgBox(0,"","Handle is: " & $firstWdw)
            EndIf
            WinGetProcess


            If $windowNumber = 1 Then
                If WinExists("[Class:IEFrame;Title:FTD - Single Sign-On;Handle:"&$firstWdw&"]") Then
;~                     MsgBox(0,"","Working till here!")
                    Local $winListT2 = WinList()
                    $winIndexT2 = _ArrayFindAll($winListT2,"Sign-On",Default,Default,Default,3,0)
                    If UBound($winIndexT2) = 4 Then
                        $firstWdw = $winListT[$winIndexT[1]][1]
                        $secondWdw = $winListT[$winIndexT[0]][1]
                        AdlibRegister("Qdetect")
                        $windowNumber = $windowNumber + 1
;~                         MsgBox(0,"","First handle is: " & $firstWdw & " Second handle is: " & $secondWdw)
                        AdlibUnRegister("Tracker")
                    EndIf
                EndIf
            EndIf
    EndIf
EndFunc



The thing is I am trying to separate two instances of the "[Class:IEFrame;Title:FTD - Single Sign-On]" when I open a new window. But when I try to open another IE to open the same page. the program still recognizes the first window. I want the program to remember the first window and the newly opened window. Any tips?

 

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