Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I determine if Internet Explorer is active 1

Status
Not open for further replies.

zggs90

Programmer
Sep 3, 2001
58
0
0
GB
I have developed a VB6 program and need to determine if "Internet Explorer" is currently running, how can I do this?

Also how can I get a list of all the applications currently running?

Thanks
 
This code determines if Internet explorer is running and, if yes, counts how many instances.
This should answer your first question.

Code:
Private Sub Command1_Click()
Dim ie As InternetExplorer
Dim oShell As ShellWindows
Dim oWin As Object
Dim sTitle As String

Set oShell = New ShellWindows

On Error Resume Next

For Each oWin In oShell
    Set ie = oWin 'Get each open ie window
    sTitle = ie.LocationName 'get the caption
    If InStr(sTitle, myIE) > 0 Then
        T = T + 1
    End If
    
Next
    If T > 0 Then
        MsgBox "Yes " & T
    Else
        MsgBox "No"
    End If

End Sub


Eman_2005
Technical Communicator
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top