473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

if IE is running

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.
Aug 25 '07 #1
4 2833
=?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.
Aug 26 '07 #2
On Aug 26, 3:02 am, Spam Catcher <spamhoney...@rogers.comwrote:
=?Utf-8?B?QmVu?= <B...@discussions.microsoft.comwrote innews:2E**********************************@micros oft.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.
Or using the Window's API you could use the FindWindow method and grab
the internet explorer windows from there. Though I like the use of the
IE API approach much better.

Thanks,

Seth Rowe

Aug 27 '07 #3
Thanks
I am in the process of trying your suggestion. So far when I run the
application, I am getting 2 system - collect showing up in a listbox when no
IE window is open and 3 with 1 window open and so on. Also, I need to work on
getting the friendly name for IE and how to actually close the open window(s)
Thanks again

"Spam Catcher" wrote:
=?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.
Aug 27 '07 #4

it might be simpler to use the process class

just loop through all the running processes and kill the process if it is a
IE instance

"Ben" <Be*@discussions.microsoft.comschreef in bericht
news:D6**********************************@microsof t.com...
Thanks
I am in the process of trying your suggestion. So far when I run the
application, I am getting 2 system - collect showing up in a listbox when
no
IE window is open and 3 with 1 window open and so on. Also, I need to work
on
getting the friendly name for IE and how to actually close the open
window(s)
Thanks again

"Spam Catcher" wrote:
>=?Utf-8?B?QmVu?= <Be*@discussions.microsoft.comwrote in
news:2E**********************************@microso ft.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.

Aug 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ross Presser | last post by:
OK, I've been researching this problem and can't find a definitive answer yet. The situation is one that seems to have come up a few times to different folks. I am writing an application that...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
by: Ennio-Sr | last post by:
Hi all! Testing a script where I need to make sure that postgresql is running before passing a <psql dbasename -c "insert into ..." > instruction I faced this curious behaviour: This is the...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
7
by: pradeep_TP | last post by:
hello all, I want to know how can I check whether a web site us running or not. I have used HttpWebRequest but when I give a web site address, It takes few number of seconds to throw exception...
3
by: Anil Kumar Sharma | last post by:
Hello, I am working on C# using vs.net 2003. I have faced two interesting problems. 1. Dynamically setting Default Button: I created a form and used it in various contexts. On basis of the...
4
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
16
by: Gandalf186 | last post by:
I need to create a query that produces running totals for every group within my table for example i wish to see: - Group A 1 5 9 15 Group B
2
by: upperclass | last post by:
Hi, I'm trying to find a decent way to measure program running time. I know clock() is probably the standard way of doing it but clock_t overflows too quickly. The target program running time...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.