Sign in to follow this  
Followers 0
nake89

Getting currently playing WMP

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Any method I can get the current play time?

Edited by fong1sky

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0