I needed a way to get what WMP was currently playing, but I couldn't find any info on it so I had to do it myself

The code is based on THIS method which gets the same info from Winamp. The difference is while Winamp has the "Artist - Title"-part
in the caption by default, WMP does not. Unless, and I found this by accident, you use a skin. In my case the skin called "Proffessional" which came with WMP worked.
While the others didn't, I guess there are more skins this will work with.

VB Code:
  1. Option Explicit
  2.  
  3. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  4. (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  5. Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
  6. (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  7. Private Declare Function GetWindowTextLength Lib "user32" _
  8. Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  9. Function getWMP()
  10.  
  11.     Dim WMP As Long, StrSong As String, BufferLen As Long
  12.  
  13.     WMP& = FindWindow("WMP Skin Host", vbNullString)
  14.     'caption WMP has in skin-mode
  15.     If WMP& = 0& Then
  16.         'the window was not found
  17.         getWMP = "window not found1"
  18.  
  19.     Else
  20.         ' window found
  21.         BufferLen& = GetWindowTextLength(WMP&)
  22.         StrSong$ = Space$(BufferLen& + 1)
  23.         Call GetWindowText(WMP&, StrSong$, Len(StrSong$))
  24.  
  25.         If InStr(StrSong$, "Windows Media Player") Then
  26.             getWMP = "window not found2"
  27. 'checks if the window has that caption, if it does, you're using a skin that doesn't work
  28.         Else
  29.             getWMP = StrSong 'call getWMP
  30.         End If
  31.  
  32.     End If
  33.  
  34. End Function
  35.  
  36. ' can be used like this:
  37. Private Sub Command1_Click()
  38.     Text1.Text = getWMP
  39. End Sub

Comments are MORE than welcome! Would be nice to know if it works with other skins, other versions of WMP (Mine is 10.0.0.3646),
or maybe on how to improve the code.