I am able to access the MediaMonkey API fairly easily. What I show below I did in VBA in Excel but I am sure it will also work in VB6. I don't do .NET but I suspect it will work with the newer versions of Visual Basic too. I did this using MediaMonkey version 4.0.1 but I don't think that matters.
In the VBA editor go to Tools | References and add "MediaMonkey Library" (the "location" tag below should show the path to MediaMonkey.exe).
Insert a module and put this code in it:
Code: Select all
Sub Test1()
Dim SDB1 As SongsDB.SDBApplication
Set SDB1 = New SongsDB.SDBApplication
With SDB1
If .Player.isPlaying Then
If .Player.isPaused Then
MsgBox "MM is running but paused now!"
End If
End If
End With
End Sub
When yo run this sub, if MM is running and paused then you get a MsgBox telling you that. It's simple but it shows how to bind with the library. I looked all over my C: drive for something "SongsDB" until I figured out it is contained within MediaMonkey.exe and this COM object is available through References.
If you want to see all of the objects that are available to you, press F2 to bring up the Object Browser and select the library "SongsDB" and it will show all of the classes, members, enumeratinos etc. that you can use.
I suggest that you do NOT use the CreateObject method. It causes the SongsDB to be bound to your code at compile time ("late binding") and not at design time ("early binding"). What that means in plain English is that when you use the References route I described then you get the IntelliSense stuff (the options after you enter a dot, object browser stuff etc.) which you do not get if you use CreateObject. The other advantage is that the code runs a lot faster because you bind well before the code is executed. I don't use scripting but if I remember correctly you have to use CreateObject there (NOT in a "real" language) because the scripting languages do not do a compile and so do not have early binding capability.