'------------------------------------------------------------------------------
#Compile Exe
#
Option Version4
#Register None
#Include "Win32api.inc"
%PROGRAM = 1024
'WINAMP WM_COMMAND Messages
%Previoustrackbutton = 40044
%Nexttrackbutton = 40048
%Playbutton = 40045
%PauseUnpausebutton = 40046
%Stopbutton = 40047
%Fadeoutandstop = 40147
%Stopaftercurrenttrack = 40157
%Fastforward5seconds = 40148
%Fastrewind5seconds = 40144
%Startofplaylist = 40154
%Gotoendofplaylist = 40158
%Openfiledialog = 40029
%OpenURLdialog = 40155
%Openfileinfobox = 40188
%Settimedisplaymodetoelapsed = 40037
%Settimedisplaymodetoremaining = 40038
%Togglepreferencesscreen = 40012
%Openvisualizationoptions = 40190
%Openvisualizationpluginoptions = 40191
%ExecutecurrentvisualizationplugIn = 40192
%Toggleaboutbox = 40041
%ToggletitleAutoscrolling = 40189
%Togglealwaysontop = 40019
%ToggleWindowshade = 40064
%TogglePlaylistWindowshade = 40266
%Toggledoublesizemode = 40165
%ToggleEQ = 40036
%Toggleplaylisteditor = 40040
%Togglemainwindowvisible = 40258
%Toggleminibrowser = 40298
%Toggleeasymove = 40186
%Raisevolumeby1percent = 40058
%Lowervolumeby1percent = 40059
%Togglerepeat = 40022
%Toggleshuffle = 40023
%Openjumptotimedialog = 40193
%Openjumptofiledialog = 40194
%Openskinselector = 40219
%ConfigurecurrentvisualizationplugIn = 40221
%Reloadthecurrentskin = 40291
%CloseWinamp = 40001
%Movesback10tracksinplaylist = 40197
%Showtheeditbookmarks = 40320
%Addscurrenttrackasabookmark = 40321
%PlayaudioCD = 40323
%LoadapresetfromEQ = 40253
%SaveapresettoEQF = 40254
%Opensloadpresetsdialog = 40172
%Opensautoloadpresetsdialog = 40173
%Loaddefaultpreset = 40174
%OpenssavepresetdiaLog = 40175
%Opensautoloadsavepreset = 40176
%Opensdeletepresetdialog = 40178
%Opensdeleteanautoloadpresetdialog = 40180
'=================================================================================================
'WINAMP WM_USER Commands
%RETRIEVE_WINAMP_VERSION = 0
'Version will be 0x20yx For 2.yx.
%START_PLAYBACK = 100
'Starts playback. A lot like hitting 'play' in Winamp, but not exactly the same
%CLEAR_WINAMP_PLAYLIST = 101
'Clears Winamp's internal playlist.
%PLAY_SELECTED_TRACK = 102
'Begins play of selected track.
%CHDIR_C_DOWNLOAD = 103
'Makes Winamp change To the directory C:\\download
%GET_PLAY_STATUS = 104
'Returns the Status of playback. If 'ret' is 1, Winamp is playing. If 'ret' is 3, Winamp is paused. Otherwise, playback is stopped.
%GET_PLAY_POSITION = 105
'If Data is 0, returns the position In milliseconds of playback. If Data is 1, returns current track length In seconds. Returns -1 If Not playing Or If an Error occur s.
%SEEK_IN_TRACK = 106
'Seeks within the current track. The offset is specified In 'data', in milliseconds.
%WRITE_CURRENT_PLAYLIST = 120
'Writes out the current playlist To Winampdir\winamp.m3u, And returns the current position In the playlist.
%SET_PLAYLIST_POSITION = 121
'Sets the playlist position To the position specified In tracks In 'data'.
%SET_VOLUME = 122
'Sets the volume To 'data', which can be between 0 (silent) and 255 (maximum).
%SET_PANNING = 123
'Sets the panning To 'data', which can be between 0 (all left) and 255 (all right).
%RETURN_PLAYLIST_LENGTH = 124
'Returns length of the current playlist, In tracks.
%RETURN_PLAYLIST_POSITION = 125
'Returns the position In the current playlist, In tracks (requires Winamp 2.05+).
%RETRUN_TRACK_INFO = 126
'Retrieves info about the current playing track. Returns samplerate (i.e. 44100) If 'data' is set to 0, bitrate if 'data' is set to 1, and number of channels if 'data ' is set to 2. (requires Winamp 2.05+)
%RETURN_EQ_ELEMENT = 127
'Retrieves one element of equalizer Data, based On what 'data' is set to.
'0-9 The 10 bands of EQ data. Will Return 0-63 (+20db - -20db)
'10 The preamp value. Will Return 0-63 (+20db - -20db)
'11 Enabled. Will Return zero If disabled, nonzero If enabled.
%RETURN_AUTOLOAD_STATUS = 128
'Autoload. Will Return zero If disabled, nonzero If enabled. To Set an element of equalizer Data, simply query which item you wish To Set Using the message above (127 ), Then Call this message With Data
%BOOKMARK_TITLE = 129
'Adds the specified file To the Winamp bookmark list
%RESTART_WINAMP = 135
'Restarts Winamp
'-----------------------------------------------------------------------
'Here is a list of the currently supported ids that you can only use From within Winamp plug-ins (since they depend On running In the same process As Winamp):
%SET_CURRENT_SKIN = 200
'Sets the current skin. 'data' points to a string that describes what skin to load, which can either be a directory or a .zip file. If no directory name is specified , the default Winamp skin directory is assumed.
%RETRIEVE_SKIN_DIR = 201
'Retrieves the current skin directory And/Or name. 'ret' is a pointer to the Skin name (or NULL if error),
' And If 'data' is non-NULL, it must point to a string 260 bytes long,
'which will receive the pathname To where the skin bitmaps are stored
'(which can be either a skin directory, Or a temporary directory when zipped skins are used)
'(Requires Winamp 2.04+).
%SELECT_AND_EXECUTE_PLUGIN = 202
'Selects And executes a visualization plug-in. 'data' points to a string which defines which plug-in to execute.
'The string can be in the following formats:
'vis_whatever.dll Executes the Default module In vis_whatever.dll In your plug-ins directory.
'vis_whatever.dll,1 executes the second module In vis_whatever.dll
'C:\path\vis_whatever.dll,1 executes the second module In vis_whatever.dll In another directory
%RETRIEVE_PLAYLIST_FILENAME = 211
'Retrieves (And returns a pointer In 'ret') a string that contains the filename of a playlist entry (indexed by 'data'). Returns NULL if error, or if 'data' is out of range.
%RETRIEVE_PLAYLISTENTRY_TITLE = 212
'Retrieves (And returns a pointer In 'ret') a string that contains the title of a playlist entry (indexed by 'data'). Returns NULL if error, or if 'data' is out of range.
%MINIBROWSER_OPEN_URL = 241
'Opens an New URL In the minibrowser. If the URL is Null it will Open the Minibrowser window
%INTERNETCONNECTION_ISALIVE = 242
'Returns 1 If the internet connecton is available For Winamp
%UPDATE_CURRENT_TITLE = 243
'Asks Winamp To update the information about the current title
%SET_PLAYLIST_ITEM = 245
'Sets the current playlist item
%RETURN_MINIBROWSER_URL = 246
'Retrives the current Minibrowser URL into the buffer.
%FLUSH_PLAYLIST_CACHE = 247
'Flushes the playlist cache buffer
%BLOCK_MINIBROWSER_UPDATES = 248
'Blocks the Minibrowser From updates If value is Set To 1
%MINIBROWSER_OPEN_NEW_URL = 249
'Opens an New URL In the minibrowser (like 241) except that it will work even If 248 is Set To 1
%RETURN_SHUFFLE_STATUS = 250
'Returns the Status of the shuffle Option (1 If Set)
%RETURN_REPEAT_STATUS = 251
'Returns the Status of the repeat Option (1 If Set)
%SET_SHUFFLE_OPTION = 252
'Sets the Status of the suffle Option (1 To turn it On)
%SET_REPEAT_OPTION = 253
'Sets the Status of the repeat Option (1 To turn it On)
'WM_COPYDATA Messages
'WM_COPYDATA messages are sent Using SendMessage() And a COPYDATASTRUCT structure. In C/C++, you can Send these messages by Using:
Type COPYDATA
dwData
As Long '= id;
lpData
As Asciiz * 256
'= (void*)Data;
cbData
As Long '= data_length;
End Type
Global cds
As COPYDATA
'SendMessage(hwndWinamp,WM_COPYDATA,(WPARAM)Null,(LPARAM)&cds);
'To Get the directory where skin bitmaps are stored (useful For plug-ins To support their own skins):
'char skin_dir[260];
'SendMessage(hwndWinamp,WM_USER,(LPARAM)skin_dir,%RETRIEVE_SKIN_DIR);
'-----------------------------------------------------------------------
Global g_hInst
As Long
Global g_hIcon
As Long
Global hwndWinamp
As Long
Global g_szSongtitle
As Asciiz * %MAX_PATH
Function WinMain (
ByVal hInstance
As Long, _
ByVal hPrevInstance
As Long, _
lpCmdLine
As Asciiz Ptr, _
ByVal iCmdShow
As Long)
As Long
Local lResult
As Long
Dim cds
As COPYDATA
Dim pptr
As Long
hwndWinamp = FindWindow("Winamp v1.x",""
If IsFalse hWndWinamp
Then
MsgBox "Winamp is not loaded!",%MB_ICONINFORMATION,"Warning!"
Exit Function
End If
lResult = GetWindowText(hwndWinamp,g_szSongtitle,SizeOf(g_szSongtitle))
MsgBox g_szSongtitle
SendMessage hWndWinamp,%WM_USER,%CloseWinamp,0
End Function