ITSky8 Posted January 28, 2008 Share Posted January 28, 2008 How to detect IE is running, and close? I know that can close the activated IE by MouseClick ("left", x,y), but if the IE's window is sized or minimized, then location will be wrong? How to do so? And detect the IE is running, by using the WinActivate, right? Link to comment Share on other sites More sharing options...
GEOSoft Posted January 28, 2008 Share Posted January 28, 2008 (edited) How to detect IE is running, and close? I know that can close the activated IE by MouseClick ("left", x,y), but if the IE's window is sized or minimized, then location will be wrong? How to do so? And detect the IE is running, by using the WinActivate, right?If ProcessExists("iexplore.exe") Then ProcessWaitClose("iexplore.exe") Edited January 28, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Paulie Posted January 28, 2008 Share Posted January 28, 2008 (edited) While 1 Sleep(1000);saves CPU If ProcessExists("IEXPLORE.exe") then ProcessClose("IEXPLORE.exe") WEnd EDIT: @GEOSoft Processwaitclose won't close it, it would just wait until it closes before continuing the script Edited January 28, 2008 by Paulie Link to comment Share on other sites More sharing options...
RWBaker Posted January 28, 2008 Share Posted January 28, 2008 While 1 Sleep(1000);saves CPU If ProcessExists("IEXPLORE.exe") then ProcessClose("IEXPLORE.exe") WEnd EDIT: @GEOSoft Processwaitclose won't close it, it would just wait until it closes before continuing the script No loop terminator in the above! Help gives a good example: ProcessClose("notepad.exe") $PID = ProcessExists("notepad.exe") ; Will return the PID or 0 if the process isn't found. If $PID Then ProcessClose($PID) RW Baker Link to comment Share on other sites More sharing options...
GEOSoft Posted January 28, 2008 Share Posted January 28, 2008 (edited) While 1 Sleep(1000);saves CPU If ProcessExists("IEXPLORE.exe") then ProcessClose("IEXPLORE.exe") WEnd EDIT: @GEOSoft Processwaitclose won't close it, it would just wait until it closes before continuing the scriptWell slap me upside the head but I think you're mistaken Paulie. Check the help file example for ProcessWaitClose() EDIT:Better slap me twice. The help file could be misleading (couldn't it?). The proper code is something like this If ProcessExists("IEXPLORE.exe") then ProcessClose("IEXPLORE.exe") Do Sleep(1) Until NOT ProcessExists("IEXPLORE.exe") EndIf Edited January 28, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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