Jump to content

Getting currently playing WMP


Recommended Posts

I have been trying to get the currently playing song from WMP for hours.

I have searched the forum but nothing has worked for me.

I am using the beta version. Could someone please help.

I would just like to get the song and the artist and then make

autoit type it to notepad or anywhere. Thank you.

$oWMP = ObjCreate("wmplayer.ocx")

$oWMPcontrols = $oWMP.controls

msgbox(0, "omg", $oWMPcontrols.currentItem)

That doesnt work... None of things I have tried works.

And yes I have WMP on.

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...

From CFire's script:

Func WMStartPlayer()
    If $pObj = 0 Then 
        $pObj = ObjCreate("WMPlayer.ocx")
    Else
        SetError(1)
    EndIf
EndFunc

Func WMOpenFile($sFilename)
    If $pObj <> 0 Then Return $pObj.newMedia($sFilename)
    If $pObj = 0 Then SetError(1)
EndFunc

Func WMPlay($sFilename)
    If $pObj <> 0 Then 
        $pObj.url = $sFilename
        While Not WMGetState() = "Playing"
            Sleep(100)
        WEnd
    EndIf
    If $pObj = 0 Then SetError(1)
EndFunc

Func WMGetPosition()
    If $pObj <> 0 Then Return $pObj.controls.currentPosition
    If $pObj = 0 Then SetError(1)
EndFunc

Func WMGetArtist($sObj)
    Return $sObj.GetItemInfo("Artist")
EndFunc

Func WMGetTitle($sObj)
    Return $sObj.GetItemInfo("Title")
EndFunc
Edited by kip
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...