'Projede Kullanılacak DLL user32.dll
'Function İse SendMessage(),PostMessage
'Projede Kullanılacak sabitler
Public Const WM_COMMAND = &H111
Public Const WM_USER = &H400
Public Const WM_WA_IPC = WM_USER
Public Const IPC_GETVERSION = 0
Public Const IPC_PLAYFILE = 100
Public Const IPC_DELETE = 101
Public Const IPC_STARTPLAY = 102
Public Const IPC_CHDIR = 103
Public Const IPC_ISPLAYING = 104
Public Const IPC_GETOUTPUTTIME = 105
Public Const IPC_JUMPTOTIME = 106
Public Const IPC_WRITEPLAYLIST = 120
Public Const IPC_SETPLAYLISTPOS = 121
Public Const IPC_SETVOLUME = 122
Public Const IPC_SETPANNING = 123
Public Const IPC_GETLISTLENGTH = 124
Public Const WINAMP_OPTIONS_EQ = 40036
Public Const WINAMP_OPTIONS_PLEDIT = 40040
Public Const WINAMP_VOLUMEUP = 40058
Public Const WINAMP_VOLUMEDOWN = 40059
Public Const WINAMP_FFWD5S = 40060
Public Const WINAMP_REW5S = 40061
Public Const WINAMP_BUTTON1 = 40044
Public Const WINAMP_BUTTON2 = 40045
Public Const WINAMP_BUTTON3 = 40046
Public Const WINAMP_BUTTON4 = 40047
Public Const WINAMP_BUTTON5 = 40048
Public Const WINAMP_BUTTON1_SHIFT = 40144
Public Const WINAMP_BUTTON2_SHIFT = 40145
Public Const WINAMP_BUTTON3_SHIFT = 40146
Public Const WINAMP_BUTTON4_SHIFT = 40147
Public Const WINAMP_BUTTON5_SHIFT = 40148
Public Const WINAMP_BUTTON1_CTRL = 40154
Public Const WINAMP_BUTTON2_CTRL = 40155
Public Const WINAMP_BUTTON3_CTRL = 40156
Public Const WINAMP_BUTTON4_CTRL = 40157
Public Const WINAMP_BUTTON5_CTRL = 40158
Public Const WINAMP_PREVSONG = 40198
Public Const WINAMP_FILE_PLAY = 40029
Public Const WINAMP_OPTIONS_PREFS = 40012
Public Const WINAMP_OPTIONS_AOT = 40019
Public Const WINAMP_HELP_ABOUT = 40041
'YAPILACAK İŞLEMLER
'1-Yeni bir proje oluşturun.
'2-Formunuza 3 tane Command buton 1 tane text ekleyin.
'(Command1 ve Command2 ve Command3 ve text1.text)
'3-Aşağıdaki kodu Formun General Declaration
'bölümüne yapıştırın.
Private Sub Command1_Click()
a = PostMessage(GetWAHandle(), WM_WA_IPC, 0, IPC_DELETE)
End Sub
Private Sub Command2_Click()
Dim C As Long
C = PostMessage(GetWAHandle(), WM_WA_IPC, 1, 105)
MsgBox C
'For f = 1 To 1000
C = PostMessage(GetWAHandle(), WM_WA_IPC, 0, 102)
Text1.Text = C
Text1.Refresh
'Next
End Sub
Private Sub Command3_Click()
SendWACommand (WINAMP_VOLUMEDOWN)
End Sub
'4-Projenize Project Add Module New ile Module1 ekleyin.
'5-Aşağıdaki kodları Module1 in general
'declarations bölümüne yapıştırın.
Public Const WM_COMMAND = &H111
Public Const WM_USER = &H400
Public Const WM_WA_IPC = WM_USER
Public Const IPC_GETVERSION = 0
Public Const IPC_PLAYFILE = 100
Public Const IPC_DELETE = 101
Public Const IPC_STARTPLAY = 102
Public Const IPC_CHDIR = 103
Public Const IPC_ISPLAYING = 104
Public Const IPC_GETOUTPUTTIME = 105
Public Const IPC_JUMPTOTIME = 106
Public Const IPC_WRITEPLAYLIST = 120
Public Const IPC_SETPLAYLISTPOS = 121
Public Const IPC_SETVOLUME = 122
Public Const IPC_SETPANNING = 123
Public Const IPC_GETLISTLENGTH = 124
Public Const WINAMP_OPTIONS_EQ = 40036
Public Const WINAMP_OPTIONS_PLEDIT = 40040
Public Const WINAMP_VOLUMEUP = 40058
Public Const WINAMP_VOLUMEDOWN = 40059
Public Const WINAMP_FFWD5S = 40060
Public Const WINAMP_REW5S = 40061
Public Const WINAMP_BUTTON1 = 40044
Public Const WINAMP_BUTTON2 = 40045
Public Const WINAMP_BUTTON3 = 40046
Public Const WINAMP_BUTTON4 = 40047
Public Const WINAMP_BUTTON5 = 40048
Public Const WINAMP_BUTTON1_SHIFT = 40144
Public Const WINAMP_BUTTON2_SHIFT = 40145
Public Const WINAMP_BUTTON3_SHIFT = 40146
Public Const WINAMP_BUTTON4_SHIFT = 40147
Public Const WINAMP_BUTTON5_SHIFT = 40148
Public Const WINAMP_BUTTON1_CTRL = 40154
Public Const WINAMP_BUTTON2_CTRL = 40155
Public Const WINAMP_BUTTON3_CTRL = 40156
Public Const WINAMP_BUTTON4_CTRL = 40157
Public Const WINAMP_BUTTON5_CTRL = 40158
Public Const WINAMP_PREVSONG = 40198
Public Const WINAMP_FILE_PLAY = 40029
Public Const WINAMP_OPTIONS_PREFS = 40012
Public Const WINAMP_OPTIONS_AOT = 40019
Public Const WINAMP_HELP_ABOUT = 40041
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
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
Public Function GetWAHandle() As Long
GetWAHandle = FindWindow("Winamp v1.x", 0)
End Function
Public Sub SendWACommand(ByVal lCommand As Long)
SendMessage GetWAHandle, WM_COMMAND, lCommand, 0
End Sub
Public Sub SendWAMessage(ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
SendMessage GetWAHandle, wMsg, wParam, lParam
End Sub
Public Sub PostWAMessage(ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
PostMessage GetWAHandle, wMsg, wParam, lParam
End Sub
'6- Projenizi Kaydedip Çalıştırın. Winamp 'ı
'çalıştırmayı unutmayın.