NewPlaza Posted October 15, 2011 Share Posted October 15, 2011 I am trying to send F5 to a hidden Internet Explorer window, and only to that window. It does however, work if it's the only IE window in existence. If I start a new instance of IE, the script wants to interact with that, not my hidden one. Another problem I'm having is it will not unhide the window when the script exits. #include <IE.au3> OnAutoItExitRegister("ShowIE") $oIE = _IECreate() _IENavigate($oIE, "http://www.google.com") WinSetState("[CLASS:IEFrame]", "Google", @SW_HIDE) While 1 Sleep(60000) ControlSend("Google", "", "[CLASS:Edit; INSTANCE:1]", "{F5}") WEnd Func ShowIE() WinSetState("[CLASS:IEFrame]", "", @SW_SHOW) EndFunc ;==>ShowIE Link to comment Share on other sites More sharing options...
Ramzes Posted October 15, 2011 Share Posted October 15, 2011 Hi NewPlaza, why you want to send [F5] to your browser? Not better is use _IENavigate to the same page again? Another problem I'm having is it will not unhide the window when the script exits.Because you are using: OnAutoItExitRegister("ShowIE")Remove it. Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font] Link to comment Share on other sites More sharing options...
NewPlaza Posted October 15, 2011 Author Share Posted October 15, 2011 (edited) Ramzes, Thanks. I didn't think of that. I have changed it to _IENavigate. I think this will work better. I'm still having problems on how to unhide the window after I exit the script. It does, however, works if it's the only IE window in existence. But if I start opening up new instances of IE, it doesnt. As you sugested, I removed the OnAutoItExitRegister func call and it will not work at all. It leaves hidden IE windows that I can't see or close. I have to launch the Task Manager and end the iexplore.exe process. Anyone know how can fix this? Thanks. New code: #include <IE.au3> ;OnAutoItExitRegister("ShowIE") $oIE = _IECreate() _IENavigate($oIE, "http://www.google.com") WinSetState("[CLASS:IEFrame]", "Google", @SW_HIDE) While 1 Sleep(60000) _IENavigate($oIE, "http://www.google.com") ;ControlSend("Google", "", "[CLASS:Edit; INSTANCE:1]", "{F5}") WEnd Func ShowIE() WinSetState("[CLASS:IEFrame]", "", @SW_SHOW) EndFunc ;==>ShowIE Edited October 15, 2011 by NewPlaza Link to comment Share on other sites More sharing options...
NewPlaza Posted October 15, 2011 Author Share Posted October 15, 2011 GOT IT! _IEQuit ($oIE)Remarks_IEQuit is particularly important when creating or working with invisible instances of Internet Explorer. When AutoIt exits when working with visible instances of a browser, the browser continues to run and the visible window is left for the user to manage. When the browser instance is invisible however, when AutoIt exits the browser process is left running and there is no user interface to interact with and an orphan Iexplore.exe process is left running on the system. The help file is remarkable! Link to comment Share on other sites More sharing options...
JohnOne Posted October 15, 2011 Share Posted October 15, 2011 Or $hWnd = _IEPropertyGet($oIE, "hwnd") You can then use any of the Win* funtions with it. 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...
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