H
halfrubbish
Guest
Hi
Iam currently trying to develop a VB.Net app to retrieve the currently playing song title from Winamp when it is running. Winamp supports the windows messages program technique/API. Iam a rather novice programmer and need help with my program. So Far I have the following source code, in theory it should work. However in practice it doesnt. The program compiles fine but doesnt do anything when the code is called. The message sent should return the winamp version number. more info availble at http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml
Any help will be appreciated. Thanks in advance.
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim hwndWinamp As Long
Dim asdf
Private Sub Timer1_Timer()
hwndWinamp = FindWindow("Winamp v1.x", vbNullString)
asdf = SendMessage(hwndWinamp, "WM_USER", "0", "0")
TextBox1.Text = asdf
End Sub
End Class
Iam currently trying to develop a VB.Net app to retrieve the currently playing song title from Winamp when it is running. Winamp supports the windows messages program technique/API. Iam a rather novice programmer and need help with my program. So Far I have the following source code, in theory it should work. However in practice it doesnt. The program compiles fine but doesnt do anything when the code is called. The message sent should return the winamp version number. more info availble at http://www.winamp.com/nsdn/winamp2x/dev/sdk/api.jhtml
Any help will be appreciated. Thanks in advance.
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim hwndWinamp As Long
Dim asdf
Private Sub Timer1_Timer()
hwndWinamp = FindWindow("Winamp v1.x", vbNullString)
asdf = SendMessage(hwndWinamp, "WM_USER", "0", "0")
TextBox1.Text = asdf
End Sub
End Class