Jump to content
Sign in to follow this  
Albert88

Song Windows Media Player

Recommended Posts

Albert88

Hello,

I have got the listview that controls the list of songs from windows media player, but when I want to know what song is singing it always show me the same song because he return me the song focused and selected, and not the playing. How can I know that song is playing exactly??

Thanks.

Share this post


Link to post
Share on other sites
BrettF

Hi,

Please remember to only bump your posts once in a 24 hour period!

Have you tried using WMP COM? There is a UDF somewhere on the forums, search for it :D

Cheers,

Brett

Share this post


Link to post
Share on other sites
Albert88

Hi,

Please remember to only bump your posts once in a 24 hour period!

Have you tried using WMP COM? There is a UDF somewhere on the forums, search for it :D

Cheers,

Brett

Ups sorry for the bump.

I looked the UDF from Squirrely1 in this post -> http://www.autoitscript.com/forum/index.ph...rt=#entry510851

However, I don´t want embed my wmp into a gui with IE. Well, my code is the next:

#Include <GuiListView.au3>

;First I look for the window
If WinExists("[CLASS:WMPlayerApp; TITLE:Reproductor de Windows Media]") Then
      ;take the handle and its control
    $hWin = WinGetHandle("[CLASS:WMPlayerApp; TITLE:Reproductor de Windows Media]")
    $hLB = ControlGetHandle($hWin, "", "[CLASS:SysListView32; INSTANCE:1]")

      ;count the list item (songs)
    $iLBCount = _GUICtrlListView_GetItemCount($hLB)
    
    For $i = 0 To $iLBCount - 1
        
              ;If a song is singing then show me
        If _GUICtrlListView_GetItemSelected($hLB,$i) == True Then       
            MsgBox(0,"Escuchas","Estás escuchando: " & @CRLF & _GUICtrllistview_getitemtext($hLB,$i))
        EndIf
    Next
Else
      ;error if wmp isn´t open
    MsgBox(16, "Error", "Windows Media Player no está abierto.")
EndIf

Exit

Then, I said that the function _GUICtrlListView_GetItemSelected($hLB,$i) show me the item selected but it can that isn´t singing, basically because I click on the song once.

Edited by Albert88

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.