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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining if another application is running..

Status
Not open for further replies.
Mar 15, 2002
82
US
Hi,

I'm trying to figure out how to determine if Internet Explorer is currently running.

I've tried the following, but it isn't working for me. I found the code below from a search on google. I don't remember which site, and I closed my IE before I bookmarked the site.

Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal _
hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

' Return the class name of the specified window
' Example: MsgBox GetWindowClass(Me.hWnd)
Function GetWindowClass(ByVal hwnd As Long) As String
Dim sClass As String

sClass = Space$(256)
GetClassName hwnd, sClass, 255
GetWindowClass = Left$(sClass, InStr(sClass, vbNullChar) - 1)
End Function

Private Sub Form_Load()

MsgBox fIsAppRunning("IEFrame.Application") 'The class of Internet Explorer is "IEFrame".

End Sub

Any ideas??

Thanks,

Bob

---------------------------------------
Bob Beck
IS Administrator

In my limited experience, 80-90% of all problems brought to my attention can be attributed to PEBCAK...the other 10-20% can be attributed to MS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top