anyquestion Posted July 12, 2011 Share Posted July 12, 2011 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 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 12, 2011 Share Posted July 12, 2011 Maybe use WinActive() in an If..Then? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
anyquestion Posted July 12, 2011 Author Share Posted July 12, 2011 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 Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 12, 2011 Share Posted July 12, 2011 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. Link to comment Share on other sites More sharing options...
anyquestion Posted July 12, 2011 Author Share Posted July 12, 2011 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now