The first part: The window that gets Winamp
Winamp is a 32-bit Windows application. That is, we can use some of the basic techniques of 32-bit Windows programming to implement control Winamp, a message system that uses Windows. Before you send a message to Winamp, you must get a handle to the Winamp window. Here's a way to do this by using an external application, such as a VB application that you have written yourself.
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim hwndWinamp as long
hwndWinamp = FindWindow("Winamp v1.x",vbNullString)
You may notice a point, why use the class name "Winamp v1.x" to FindWindow? Because all versions of Winamp 1.x and 2.x are in the class name "Winamp v1.x".
Part II: Using messages
Winamp the corresponding three messages: Wm_user,wm_command, and Wm_copydata. Wm_user and Wm_copydata allow you to have some advanced control over the Winamp. And WM_COMMAND can do some simple things like pause, play, and jump to the next piece of music.
1.wm_command message:
Previous Track Button 40044
Next Track Button 40048
Play button 40045
Pause/unpause Button 40046
Stop Button 40047
Fadeout and Stop 40147
Stop after current track 40157
Fast-forward 5 seconds 40148
Fast-rewind 5 Seconds 40144
Start of Playlist 40154
Go to end of playlist 40158
Open File Dialog 40029
Open URL Dialog 40155
Open File info Box 40188
Set time display mode to elapsed 40037
Set time display mode to remaining 40038
Toggle Preferences Screen 40012
Open Visualization Options 40190
Open Visualization Plug-in Options 40191
Execute Current Visualization Plug-in 40192
Toggle About Box 40041
Toggle title Autoscrolling 40189
Toggle always on top 40019
Toggle WindowShade 40064
Toggle Playlist WindowShade 40266
Toggle doublesize Mode 40165
Toggle EQ 40036
Toggle Playlist Editor 40040
Toggle main Window Visible 40258
Toggle Minibrowser 40298
Toggle Easymove 40186
Raise Volume by 1% 40058
Lower Volume by 1% 40059
Toggle Repeat 40022
Toggle Shuffle 40023
Open jump to Time dialog 40193
Open jump to File Dialog 40194
Open Skin Selector 40219
Configure Current Visualization Plug-in 40221
Reload the current skin 40291
Close Winamp 40001
Moves back tracks in playlist 40197
Show the edit bookmarks 40320
Adds current track as a bookmark 40321
Play Audio CD 40323
Load a preset from EQ 40253
Save a preset to EQF 40254
Opens Load Presets dialog 40172
Opens Auto-load Presets Dialog 40173
Load Default Preset 40174
Opens Save Preset dialog 40175
Opens Auto-load Save preset 40176
Opens Delete Preset dialog 40178
Opens delete an auto load Preset dialog 40180