Results 1 to 5 of 5

Thread: Winamp / WMP

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2005
    Posts
    294

    Winamp / WMP

    Is there a way to get Winamps and or Windows Media Players current media with VB6?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: Winamp / WMP

    Quote Originally Posted by frozen
    Is there a way to get Winamps and or Windows Media Players current media with VB6?
    What do you mean by "current media"?

  3. #3
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: Winamp / WMP

    For WinAmp, you can find current playlist in WinAmpPath:\\WinAmp.m3u.

    No idea how to get the 'now playing' file.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  4. #4
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Winamp / WMP

    to get the current song being played by Winamp, try this:
    VB Code:
    1. Option Explicit
    2. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    3. Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    4. Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    5.  
    6. Private Sub Command1_Click()
    7. Dim Wmp As Long, strSong As String, Buff As Long
    8.  
    9. 'here Winamp v1.x is the classname of Winamp, and is different for
    10. 'different versions i suppose, so check the classname using Spy++
    11. Wmp = FindWindow("Winamp v1.x", vbNullString)
    12.  
    13. If Wmp <> 0 Then
    14.     Buff = GetWindowTextLength(Wmp)
    15.  
    16.     strSong = Space(Buff + 1)
    17.    
    18.     GetWindowText Wmp, strSong, Len(strSong)
    19.    
    20.     'when winamp plays a song, it includes "- Winamp" at
    21.     'the end, to eliminate it use
    22.     strSong = Replace(strSong, " - Winamp", vbNullString)
    23.    
    24.     MsgBox "Song Playing: " & strSong
    25. Else
    26.     MsgBox "Winamp is NOT open", vbOKOnly, "Error - Winamp not found"
    27. End If
    28.  
    29. End Sub
    Harsh
    Show Appreciation. Rate Posts.

  5. #5
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Winamp / WMP

    How would I get this to work for WMP 11?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width