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

Is there a way to monitor if an app is running on the system 1

Status
Not open for further replies.

JamesBBB

Technical User
Nov 2, 2005
74
GB
Hi All, I wonder if someone could help me please, I am writing a database for my music collection and the player I use is called coolplayer.exe, a very small mp3 player that sits in the system tray. However, what I would like to do is check when coolplayer is running so that I can show or hide buttons depending on its state. Ithough I saw some time ago a piece of code that can check for applications running, I have search tek tip and seen some chat about Excell but not a generic program such as coolplayer.
The reference site to coolplayer is here

Is there a way I can do this, and could someone help me, many thanks

James
 
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long


If FindWindow(vbNullString, "CoolPlayer") = 0 Then
    [COLOR=black cyan]' It is NOT Running[/color]
Else
    [COLOR=black cyan]' It IS Running[/color]
End IF
 
Golum

Absolutely Spot on perfect

Many thanks

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top