Hi there, newbie me trying to fight this thing about fetching the path of a song playing in winamp (using my app of course).
Been searching everywhere for ways to do it but came up empty handed so far
That was until I came accross this module which seems to be able to.
My problem is I can call the file info panel from my app (using code from module below) but how do I extract the file path of this file info panel?
( see attached jpg - highlighted area) Am I al least on the right track here??
Anybody !!
Tnxs

VB Code:
  1. Option Explicit
  2. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  3. Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
  4. Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal HWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  5. Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal HWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  6. Public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (ByVal HWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  7. Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal HWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
  8.  
  9.  
  10. Public Sub winampGetFileInfo(Optional strFilepath As String, Optional strTitle As String, Optional strArtist As String, Optional strAlbum As String, Optional strYear As String, Optional strComment As String)
  11.     'I coded this to only read the info from a Mp3, will freeze if file info box is not
  12.     '   an id3 tag window.  Can easily be edited.
  13.     Dim lngMpegFileInfo As Long
  14.     Dim lngEdit1 As Long
  15.     Dim lngEdit2 As Long
  16.     Dim lngEdit3 As Long
  17.     Dim lngEdit4 As Long
  18.     Dim lngEdit5 As Long
  19.     Dim lngEdit6 As Long
  20.    
  21.     If lngWinamp = 0 Then Exit Sub
  22.     PostMessage lngWinamp, 273, 40188, 0
  23.     Do
  24.         DoEvents
  25.         lngMpegFileInfo = FindWindow("#32770", "MPEG file info box + ID3 tag editor")
  26.         lngEdit1 = FindWindowEx(lngMpegFileInfo, 0, "Edit", vbNullString)
  27.         lngEdit2 = FindWindowEx(lngMpegFileInfo, lngEdit1, "Edit", vbNullString)
  28.         lngEdit3 = FindWindowEx(lngMpegFileInfo, lngEdit2, "Edit", vbNullString)
  29.         lngEdit4 = FindWindowEx(lngMpegFileInfo, lngEdit3, "Edit", vbNullString)
  30.         lngEdit5 = FindWindowEx(lngMpegFileInfo, lngEdit4, "Edit", vbNullString)
  31.         lngEdit6 = FindWindowEx(lngMpegFileInfo, lngEdit5, "Edit", vbNullString)
  32.     Loop Until lngEdit6 <> 0
  33.     strFilepath = strGettext(lngEdit6)
  34.     strTitle = strGettext(lngEdit1)
  35.     strArtist = strGettext(lngEdit2)
  36.     strAlbum = strGettext(lngEdit3)
  37.     strYear = strGettext(lngEdit4)
  38.     strComment = strGettext(lngEdit5)
  39.     DoEvents
  40.     PostMessage lngMpegFileInfo, &H10, 0, 0
  41.  
  42. End Sub