home *** CD-ROM | disk | FTP | other *** search
/ Hacker 9 / HACKER09.ISO / Utils / winamp192.exe / FRONTEND.TXT < prev    next >
Text File  |  1998-05-07  |  5KB  |  151 lines

  1. #define WM_WA_IPC WM_USER
  2. // messages are sent to the winamp window using:
  3. //result = SendMessage(hwnd_winamp,WM_WA_IPC,command_data,command);
  4.  
  5.  
  6. /* Messages available to send */
  7.  
  8. #define IPC_GETVERSION 0
  9. /*
  10.     IPC_GETVERSION is sent to the window, and the return value is the version
  11.         Version 1.55 = 0x1551
  12.         Version 1.6b = 0x16A0
  13.         Version 1.60 = 0x16AF
  14.         Version 1.61 = 0x16B0
  15.         Version 1.62 = 0x16B1
  16.         Version 1.64 = 0x16B3
  17.         Version 1.666 = 0x16B4
  18.         Version 1.69 = 0x16B5
  19.         Version 1.70 = 0x1700
  20.         Version 1.72 = 0x1702
  21.         Version 1.73 = 0x1703
  22.         Version 1.80 = 0x1800
  23.         Version 1.81 = 0x1801
  24.         Version 1.82 = 0x1802
  25.         Version 1.90 = 0x1900
  26.         Version 1.91 = 0x1901
  27.     the command_data parameter is 0.
  28.     so, 
  29.     if (SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) != 0x1551)
  30.         MessageBox(NULL,"Error, Winamp 1.55 not found","Warning",MB_OK);
  31. */
  32.  
  33.  
  34. #define IPC_PLAYFILE 100
  35. /*
  36.     IPC_PLAYFILE is sent to the window for each char of a null terminated string of a file to ADD
  37.     to the playlist (it doesn't change the playing status). Note, if you pass a file with the extension
  38.     ".m3u" it will be treated as a playlist.
  39.     for example:
  40.         char *file = "C:\\download\\booga.mp3";
  41.         int x;
  42.         for (x = 0; x <= strlen(file); x ++)
  43.             PostMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)file[x],IPC_PLAYFILE);
  44.     will add "C:\download\booga.mp3" to the end of the playlist
  45. */
  46.  
  47. #define IPC_DELETE 101
  48. /* 
  49.     IPC_DELETE deletes the internal Winamp playlist.
  50.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
  51. */
  52.  
  53. #define IPC_STARTPLAY 102
  54. /* 
  55.     IPC_STARTPLAY starts the playing.
  56.         SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
  57. */
  58.  
  59. #define IPC_CHDIR 103
  60. /*
  61.     IPC_CHDIR is sent to the window for each char of a null terminated string of a directory to change to
  62.     for example:
  63.         char *dir = "C:\\Download";
  64.         int x;
  65.         for (x = 0; x <= strlen(file); x ++)
  66.             PostMessage(hwnd_winamp,WM_WA_IPC,(LPARAM)dir[x],IPC_PLAYFILE);
  67.     will change the winamp process to "C:\download" (useful for relative pathnames and loading playlists)
  68.  
  69. */
  70. #define IPC_ISPLAYING 104
  71. /*
  72.     IPC_ISPLAYING returns the status of playback.
  73.     If it returns 1, it is playing. if it returns 3, it is paused, if it returns 0, it is not playing.
  74.     If it returns something other than 1,3,or 0, something is screwed.
  75.     isplaying = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
  76. */
  77.  
  78.  
  79. #define IPC_GETOUTPUTTIME 105
  80. /*
  81.     IPC_GETOUTPUTTIME returns the position in milliseconds of the 
  82.           current song (lParam = 0), or the song length, in seconds (lParam = 1).
  83.     Returns -1 if not playing or error.
  84.         
  85.     song_pos = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME);
  86.     song_len = SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETOUTPUTTIME);
  87. */
  88.  
  89. #define IPC_JUMPTOTIME 106
  90. /*
  91.         *ONLY AVAILABLE IN v1.60+*
  92.     IPC_JUMPTOTIME sets the position in milliseconds of the current song (approximately)
  93.     Returns -1 if not playing, 1 on eof, or 0 if successful
  94.     SendMessage(hwnd_winamp,WM_WA_IPC,new_song_pos,IPC_JUMPTOTIME);
  95. */
  96. #define IPC_WRITEPLAYLIST 120
  97. /*
  98.         *ONLY AVAILABLE IN v1.666+*
  99.     IPC_WRITEPLAYLIST writes the current playlist to <winampdir>\\Winamp.pl
  100.     int cursong =  SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
  101.     (cursong is the index of the current song in the playlist)
  102. */
  103.  
  104.  
  105. // THESE MIGHT CHANGE in the future :)
  106. //Also, you can send standard WM_COMMAND messages to the Winamp window (for other controls), including
  107. // Send using SendMessage(hwnd_winamp,WM_COMMAND,WINAMP_OPTIONS_EQ/*orwhatever*/,0);
  108.  
  109. // toggles the EQ window
  110. #define WINAMP_OPTIONS_EQ               40036
  111. // toggles the playlist window
  112. #define WINAMP_OPTIONS_PLEDIT           40040
  113. // turns the volume up a little
  114. #define WINAMP_VOLUMEUP                 40058
  115. // turns the volume down a little
  116. #define WINAMP_VOLUMEDOWN               40059
  117. // fast forwards 5 seconds
  118. #define WINAMP_FFWD5S                   40060
  119. // rewinds 5 seconds
  120. #define WINAMP_REW5S                    40061
  121. // the following are the five main control buttons, with optionally shift or control pressed
  122. // (for the exact functions of each, just try it out)
  123. #define WINAMP_BUTTON1                  40044
  124. #define WINAMP_BUTTON2                  40045
  125. #define WINAMP_BUTTON3                  40046
  126. #define WINAMP_BUTTON4                  40047
  127. #define WINAMP_BUTTON5                  40048
  128. #define WINAMP_BUTTON1_SHIFT            40144
  129. #define WINAMP_BUTTON2_SHIFT            40145
  130. #define WINAMP_BUTTON3_SHIFT            40146
  131. #define WINAMP_BUTTON4_SHIFT            40147
  132. #define WINAMP_BUTTON5_SHIFT            40148
  133. #define WINAMP_BUTTON1_CTRL             40154
  134. #define WINAMP_BUTTON2_CTRL             40155
  135. #define WINAMP_BUTTON3_CTRL             40156
  136. #define WINAMP_BUTTON4_CTRL             40157
  137. #define WINAMP_BUTTON5_CTRL             40158
  138.  
  139. // always goes to the previous song (unlike button 1), 1.666+
  140. #define WINAMP_PREVSONG                    40198
  141.  
  142. // pops up the load file(s) box
  143. #define WINAMP_FILE_PLAY                40029
  144. // pops up the preferences
  145. #define WINAMP_OPTIONS_PREFS            40012
  146. // toggles always on top
  147. #define WINAMP_OPTIONS_AOT              40019
  148. // pops up the about box :)
  149. #define WINAMP_HELP_ABOUT               40041
  150.  
  151.