Jump to content

How to know active instance in _IEAttach

Recommended Posts


How can I know the instance that is active when using _IEAttach ?

For example, I have 2 instances with the same title. When I write:

$oIE = _IEAttach("Program Tittle", "WindowTitle")

it always returns the link to the first instance, but not to the active one

(the one the user has selected to work with)

Can you help?



Link to post
Share on other sites

Maybe use WinActive() in an If..Then?


I have test it, but WinActive doesn't work with IE instances or I am doing something wrong.

We have 3 instances and we want this script to stop (select) the second one, but it always takes the last, the 3rd.

$i = 1

While 1

$oIE1 = _IEAttach("ProgramTittle", "WindowTitle",$i)

If @error = $_IEStatus_NoMatch Then ExitLoop

If WinActive("[TITLE:ProgramTittle; INSTANCE:2]", "") then ExitLoop

$i += 1


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...