cmgrider 0 Posted September 12, 2011 The follow explains the setup of application that I need help with... Local client is installed on computerIE connects to webserver which autolaunches seperate login window. (background IE stays open and must until login is complete)Onced logged in another window opens which is the working app page.The background IE window stays open unless we hide or close it. I have scripted the launch of the IE window Hidden and I have configured a handle to close the background IE once logged into the application.My problem is that if the application is launched and the user gets to the login prompt, but decides to click exit instead of logging in the background IE process never goes away.What I am looking for is a way to recognize if the user clicks the Exit button and then run a command to close the IE window that is running in the background.If the user clicks login I want to skip this function and continue as normal and then exit the background IE window. (which I have working) Here is my script: $val = Run("C:\Program Files (x86)\Internet Explorer\Iexplore.exe http://server/app/path/", "C:\Program Files (x86)\Internet Explorer\", @SW_HIDE)WinWait("[CLASS:CentricityLogonDlg]")WinWait("[CLASS:AfxFrameOrView90]")$handle = WinGetHandle("Start Centricity® Practice Solution 10.0 - Windows Internet Explorer", "")WinClose($handle) What I am in need of help on is after launch of CentrcityLOGONDlg, if user selects exit button I want to close IE as well.Any help is appreciated... Share this post Link to post Share on other sites
cmgrider 0 Posted September 13, 2011 OK.. I was able to come up with a solution to this.. here is the code I used. If you have any questions or advice on making script better I welcome them. Opt("TrayIconHide", 1)$val = Run("C:\Program Files (x86)\Internet Explorer\Iexplore.exe http://servername/appdir/dir/", "C:\Program Files (x86)\Internet Explorer\", @SW_SHOWMINIMIZED)WinWait("[CLASS:appclassname]")WinWaitNotActive("[CLASS:appclassname")sleep (6000)$handle = WinGetHandle("IE WINDOW NAME 10.0 - Windows Internet Explorer", "")WinClose($handle) Share this post Link to post Share on other sites
wakillon 403 Posted September 16, 2011 (edited) Why not use IE ? #include <IE.au3> $oIE = _IECreate ( " http://server/app/path/" ) $hIE = _IEPropertyGet ( $oIE, "HWND" ) While 1 Sleep ( 20 ) If Not WinExists ( $hIE ) Then ExitLoop WEnd If windows is closed, script can exit... Edited September 16, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites