Zohar Posted September 8, 2014 Share Posted September 8, 2014 Hi I am using Windows XP SP3 with IE8. Many times, if you open IE, enter some URL, and press "Go", and then move to another window while IE loads the page, then when IE finishes loading the page, the IE window will take focus from the other window you were on. This interferes with one script of mine, where I need to switch to another window, and do not want the focus to be stolen, only when I do it manually. Does anyone know how to disable this behavior in IE? So when a webpage finishes loading, it will not take focus from another window, if another window is active.. Thank you Link to comment Share on other sites More sharing options...
david1337 Posted September 8, 2014 Share Posted September 8, 2014 (edited) How about waiting for the page to load, and then continue the script? Notice what the window is called when the page is done loading. Like "Google - Internet Explorer" Winwaitactive("Google - Internet Explorer") continue script Edited September 8, 2014 by david1337 Link to comment Share on other sites More sharing options...
Zohar Posted September 8, 2014 Author Share Posted September 8, 2014 Hi David Thank you, of course that is an option, but not a prefered one. Maybe someone knows a setting in IE that can disable IE taking focus from other windows? Link to comment Share on other sites More sharing options...
JohnOne Posted September 8, 2014 Share Posted September 8, 2014 Can you give an example of a URL that causes this, because I have never ever seen this behaviour before. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Zohar Posted September 26, 2014 Author Share Posted September 26, 2014 (edited) Hi JohnOne and sorry for the late reply It happened to me several times, in several websites, some of them require log in, so I will simply give you the HTML code that does it: If you create a file called FocusTest.html, and put this in it: <body onload="self.focus();"> Then this html page will steal focus every time when loaded. In orer to test it, you need to open it with IE, but because you're alraedy focussed on it, then you will not see the problem.. So after opening the file, do this: Create a small AutoIt script, and put this inside: Local $hIntExp =WinGetHandle("D:\SomeFolder\FocusTest.html - Windows Internet Explorer") ControlSend($hExp,"","Internet Explorer_Server1","{F5}") Then, run the script, while the IE window is not focussed, and see what happens. IE will take focus from whatever other window that was open. And that's what I am trying to disable - to disable IE from taking focus from other applications when the focus is on them. I am 90% sure I have seen a setting for that in IE, but now when I need it I do not see it.. I am using Windows XP SP3.. Edited September 26, 2014 by Zohar 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