|
-
Apr 12th, 2006, 06:50 PM
#1
Thread Starter
Hyperactive Member
Winamp / WMP
Is there a way to get Winamps and or Windows Media Players current media with VB6?
-
Apr 13th, 2006, 08:19 AM
#2
Re: Winamp / WMP
 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"?
-
Apr 13th, 2006, 10:40 AM
#3
Re: Winamp / WMP
For WinAmp, you can find current playlist in WinAmpPath:\\WinAmp.m3u.
No idea how to get the 'now playing' file.
-
Apr 13th, 2006, 01:47 PM
#4
Re: Winamp / WMP
to get the current song being played by Winamp, try this:
VB Code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim Wmp As Long, strSong As String, Buff As Long
'here Winamp v1.x is the classname of Winamp, and is different for
'different versions i suppose, so check the classname using Spy++
Wmp = FindWindow("Winamp v1.x", vbNullString)
If Wmp <> 0 Then
Buff = GetWindowTextLength(Wmp)
strSong = Space(Buff + 1)
GetWindowText Wmp, strSong, Len(strSong)
'when winamp plays a song, it includes "- Winamp" at
'the end, to eliminate it use
strSong = Replace(strSong, " - Winamp", vbNullString)
MsgBox "Song Playing: " & strSong
Else
MsgBox "Winamp is NOT open", vbOKOnly, "Error - Winamp not found"
End If
End Sub
Harsh
-
Mar 1st, 2007, 03:30 PM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|