=?Utf-8?B?QmVu?= <Be*@discussions.microsoft.comwrote in
news:2E**********************************@microsof t.com:
Is there a way, with either VB 2005 express or vb 2008 express, to
tell if IE is running and to be able to close it from with my
application. I already know how to start IE, what I want is to be able
to to detect if IE is running and to be able to close or open IE as
needed. I do not want to kill the IE process, just to be able to close
it.
Using the IE API you can loop through all the windows:
Dim _IEWindows As SHDocVw.ShellWindows = New SHDocVw.ShellWindowsClass
For Each IE As SHDocVw.InternetExplorer In _IEWindows
'Do something here
Next
You need to reference ShDocVw which is the Internet Explorer COM object.