Jump to content
Sign in to follow this  
anyquestion

How to know active instance in _IEAttach

Recommended Posts

anyquestion

Hello,

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?

Thanks

Anyquestion

Share this post


Link to post
Share on other sites
somdcomputerguy

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


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
anyquestion

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

Thanks.

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

WEnd

Share this post


Link to post
Share on other sites
somdcomputerguy

I was thinking along the lines of: If WinActive Then _IEAttach, but I probably misread your post.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
anyquestion

I was thinking along the lines of: If WinActive Then _IEAttach, but I probably misread your post.

No prob. Perhaps someone else can bring some ligth

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.