Jump to content
Sign in to follow this  

Close IE on seperate login box button click Help

Recommended Posts

The follow explains the setup of application that I need help with...

Local client is installed on computer

IE 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)



$handle = WinGetHandle("Start Centricity® Practice Solution 10.0 - Windows Internet Explorer", "")


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

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)



sleep (6000)

$handle = WinGetHandle("IE WINDOW NAME 10.0 - Windows Internet Explorer", "")


Share this post

Link to post
Share on other sites

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

If windows is closed, script can exit...

Edited by wakillon

AutoIt X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...