flyonthewall Posted January 30, 2009 Posted January 30, 2009 hello,at the end of an install, a new ie browser launches to ask the end-user for their email address and to be notified of updates...i only want to close this one ie browser in case they have several open.address http://www.xobni.com/uninstalled?ver=1.6.3...6-B07F2DEC90A3}any help would be much appreciatedthanks#include <IE.au3> _IEQuit ( ByRef $o_object )
furrycow Posted January 30, 2009 Posted January 30, 2009 (edited) hello, at the end of an install, a new ie browser launches to ask the end-user for their email address and to be notified of updates... i only want to close this one ie browser in case they have several open. address http://www.xobni.com/uninstalled?ver=1.6.3...6-B07F2DEC90A3} any help would be much appreciated thanks #include <IE.au3> _IEQuit ( ByRef $o_object ) The variable you gave the _IECreate(), just use that same variable in _IEQuit() eg $oIE=_IECreate("http://www.xobni.com/uninstalled?ver=1.6.3...6-B07F2DEC90A3}") _IEQuit($oIE) Edited January 30, 2009 by furrycow Instant Lockerz Invite - www.instantlockerzinvite.co.uk
flyonthewall Posted January 30, 2009 Author Posted January 30, 2009 The variable you gave the _IECreate(), just use that same variable in _IEQuit() eg $oIE=_IECreate("http://www.xobni.com/uninstalled?ver=1.6.3...6-B07F2DEC90A3}") _IEQuit($oIE) thanks for the reply the variable _IECreate opens a new window, then _IEQuit closes the new window, but the browser window that was launched from the install remains open. hope that makes sense. thank you again. i'm still reading the help file, and searching as much as i can.
SpookMeister Posted January 30, 2009 Posted January 30, 2009 (edited) Since your script did not open the file, it has no way (at this point) of knowing which window to close. If the page that opens has a specific name or text in the tile bar, you might be able to use WinClose() Use the Autoit Window Info tool (Start|Programs|Autoit v3|Autoit Window Info) to look at it Edited January 30, 2009 by SpookMeister [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
flyonthewall Posted January 30, 2009 Author Posted January 30, 2009 Since your script did not open the file, it has no way (at this point) of knowing which window to close. If the page that opens has a specific name or text in the tile bar, you might be able to use WinClose() Use the Autoit Window Info tool (Start|Programs|Autoit v3|Autoit Window Info) to look at it thank you for the reply and the info. i was trying WinWaitActive but did not know how to close...but this works just fine below: If WinExists("Why did you uninstall? - Microsoft Internet Explorer", "") Then WinClose("Why did you uninstall? - Microsoft Internet Explorer", "") EndIf thanks again. ciao
Authenticity Posted January 30, 2009 Posted January 30, 2009 iexplore.exe is always the name of the process. If you want to close all the iexplore.exe processes just use some loop to check whether iexplore.exe still exists and terminate it. If you want to close only your new iexplore.exe process use the _IEPropertyGet($oIE, 'hwnd') call to get the main window's handle and handle it via Win* functions.
SpookMeister Posted January 30, 2009 Posted January 30, 2009 FYI, if you are only doing a single command in an if statement, doing the statement in a single line is slightly faster/more efficient. $title = "Why did you uninstall? - Microsoft Internet Explorer" If WinExists($title, "") Then WinClose($title, "") [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]
flyonthewall Posted January 30, 2009 Author Posted January 30, 2009 (edited) FYI, if you are only doing a single command in an if statement, doing the statement in a single line is slightly faster/more efficient. $title = "Why did you uninstall? - Microsoft Internet Explorer" If WinExists($title, "") Then WinClose($title, "") great..i will give it a try. thks again. update*** works awesome! ty Edited January 30, 2009 by flyonthewall
DaleHohm Posted January 30, 2009 Posted January 30, 2009 A single iexplorer.exe or window (with tabs) can control multiple IE instances. Please see _IEAttach Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
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