by Indi » Thu Jun 03, 2004 10:56 am
Well, a bit of poking around found a status flag in the WinAmpAPI. Installing WinAmpCom 2.1.1 (gen_com.dll) into the Plugins folder gives access to this and other functions. Though I'm still sorting it all out, it appears that status=0 means winamp is not playing, status=1 means that winamp is playing, status=3 means that WinAmp is paused.
Below is a VBS to determine if MediaMonkey is running. Hope this helps others out. If anyone knows how to accomplish this through the WinAmpAPI, it would much appreciated.
'IS MEDIA MONKEY RUNNING?
Set WshShell = WScript.CreateObject("WScript.Shell")
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'MediaMonkey.exe'")
running = props.Count
If running > 0 Then
MsgBox "MediaMonkey IS Running", 65, "Alert"
Else
'Program is not running
MsgBox "MediaMonkey is NOT running", 65, "Alert"
End If
Set WSHShell = Nothing
Well, a bit of poking around found a status flag in the WinAmpAPI. Installing WinAmpCom 2.1.1 (gen_com.dll) into the Plugins folder gives access to this and other functions. Though I'm still sorting it all out, it appears that status=0 means winamp is not playing, status=1 means that winamp is playing, status=3 means that WinAmp is paused.
Below is a VBS to determine if MediaMonkey is running. Hope this helps others out. If anyone knows how to accomplish this through the WinAmpAPI, it would much appreciated.
'IS MEDIA MONKEY RUNNING?
Set WshShell = WScript.CreateObject("WScript.Shell")
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
Set props = service.ExecQuery("select name, description from Win32_Process where name = 'MediaMonkey.exe'")
running = props.Count
If running > 0 Then
MsgBox "MediaMonkey IS Running", 65, "Alert"
Else
'Program is not running
MsgBox "MediaMonkey is NOT running", 65, "Alert"
End If
Set WSHShell = Nothing