wa_ipc.h 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468
  1. /*
  2. ** Copyright (C) 1997-2008 Nullsoft, Inc.
  3. **
  4. ** This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held
  5. ** liable for any damages arising from the use of this software.
  6. **
  7. ** Permission is granted to anyone to use this software for any purpose, including commercial applications, and to
  8. ** alter it and redistribute it freely, subject to the following restrictions:
  9. **
  10. ** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
  11. ** If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  12. **
  13. ** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  14. **
  15. ** 3. This notice may not be removed or altered from any source distribution.
  16. **
  17. */
  18. #ifndef _WA_IPC_H_
  19. #define _WA_IPC_H_
  20. #include <windows.h>
  21. #include <stddef.h>
  22. #if (_MSC_VER <= 1200)
  23. typedef int intptr_t;
  24. #endif
  25. /*
  26. ** This is the modern replacement for the classic 'frontend.h'. Most of these
  27. ** updates are designed for in-process use, i.e. from a plugin.
  28. **
  29. */
  30. /* Most of the IPC_* messages involve sending the message in the form of:
  31. ** result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);
  32. ** Where different then this is specified (typically with WM_COPYDATA variants)
  33. **
  34. ** When you use SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*) and specify a IPC_*
  35. ** which is not currently implemented/supported by the Winamp version being used then it
  36. ** will return 1 for 'result'. This is a good way of helping to check if an api being
  37. ** used which returns a function pointer, etc is even going to be valid.
  38. */
  39. #define WM_WA_IPC WM_USER
  40. #define WINAMP_VERSION_MAJOR(winampVersion) ((winampVersion & 0x0000FF00) >> 12)
  41. #define WINAMP_VERSION_MINOR(winampVersion) (winampVersion & 0x000000FF) // returns, i.e. 0x12 for 5.12 and 0x10 for 5.1...
  42. #define IPC_GETVERSION 0
  43. /* int version = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION);
  44. **
  45. ** The version returned will be 0x20yx for Winamp 2.yx.
  46. ** Versions previous to Winamp 2.0 typically (but not always) use 0x1zyx for 1.zx.
  47. ** Just a bit weird but that's the way it goes.
  48. **
  49. ** For Winamp 5.x it uses the format 0x50yx for Winamp 5.yx
  50. ** e.g. 5.01 -> 0x5001
  51. ** 5.09 -> 0x5009
  52. ** 5.1 -> 0x5010
  53. **
  54. ** Notes: For 5.02 this api will return the same value as for a 5.01 build.
  55. ** For 5.07 this api will return the same value as for a 5.06 build.
  56. */
  57. #define IPC_GETVERSIONSTRING 1
  58. #define IPC_GETREGISTEREDVERSION 770
  59. /* (requires Winamp 5.0+)
  60. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETREGISTEREDVERSION);
  61. **
  62. ** This will open the Winamp Preferences and show the Winamp Pro page.
  63. */
  64. typedef struct {
  65. const char *filename;
  66. const char *title;
  67. int length;
  68. } enqueueFileWithMetaStruct; // send this to a IPC_PLAYFILE in a non WM_COPYDATA,
  69. // and you get the nice desired result. if title is NULL, it is treated as a "thing",
  70. // otherwise it's assumed to be a file (for speed)
  71. typedef struct {
  72. const wchar_t *filename;
  73. const wchar_t *title;
  74. int length;
  75. } enqueueFileWithMetaStructW;
  76. #define IPC_PLAYFILE 100 // dont be fooled, this is really the same as enqueufile
  77. #define IPC_ENQUEUEFILE 100
  78. #define IPC_PLAYFILEW 1100
  79. #define IPC_ENQUEUEFILEW 1100
  80. /* This is sent as a WM_COPYDATA with IPC_PLAYFILE as the dwData member and the string
  81. ** of the file / playlist to be enqueued into the playlist editor as the lpData member.
  82. ** This will just enqueue the file or files since you can use this to enqueue a playlist.
  83. ** It will not clear the current playlist or change the playback state.
  84. **
  85. ** COPYDATASTRUCT cds = {0};
  86. ** cds.dwData = IPC_ENQUEUEFILE;
  87. ** cds.lpData = (void*)"c:\\test\\folder\\test.mp3";
  88. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  89. ** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  90. **
  91. **
  92. ** With 2.9+ and all of the 5.x versions you can send this as a normal WM_WA_IPC
  93. ** (non WM_COPYDATA) with an enqueueFileWithMetaStruct as the param.
  94. ** If the title member is null then it is treated as a "thing" otherwise it will be
  95. ** assumed to be a file (for speed).
  96. **
  97. ** enqueueFileWithMetaStruct eFWMS = {0};
  98. ** eFWMS.filename = "c:\\test\\folder\\test.mp3";
  99. ** eFWMS.title = "Whipping Good";
  100. ** eFWMS.length = 300; // this is the number of seconds for the track
  101. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&eFWMS,IPC_ENQUEUEFILE);
  102. */
  103. #define IPC_DELETE 101
  104. #define IPC_DELETE_INT 1101
  105. /* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_DELETE);
  106. ** Use this api to clear Winamp's internal playlist.
  107. ** You should not need to use IPC_DELETE_INT since it is used internally by Winamp when
  108. ** it is dealing with some lame Windows Explorer issues (hard to believe that!).
  109. */
  110. #define IPC_STARTPLAY 102
  111. #define IPC_STARTPLAY_INT 1102
  112. /* SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_STARTPLAY);
  113. ** Sending this will start playback and is almost the same as hitting the play button.
  114. ** The IPC_STARTPLAY_INT version is used internally and you should not need to use it
  115. ** since it won't be any fun.
  116. */
  117. #define IPC_CHDIR 103
  118. /* This is sent as a WM_COPYDATA type message with IPC_CHDIR as the dwData value and the
  119. ** directory you want to change to as the lpData member.
  120. **
  121. ** COPYDATASTRUCT cds = {0};
  122. ** cds.dwData = IPC_CHDIR;
  123. ** cds.lpData = (void*)"c:\\download";
  124. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  125. ** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  126. **
  127. ** The above example will make Winamp change to the directory 'C:\download'.
  128. */
  129. #define IPC_ISPLAYING 104
  130. /* int res = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING);
  131. ** This is sent to retrieve the current playback state of Winamp.
  132. ** If it returns 1, Winamp is playing.
  133. ** If it returns 3, Winamp is paused.
  134. ** If it returns 0, Winamp is not playing.
  135. */
  136. #define IPC_GETOUTPUTTIME 105
  137. /* int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
  138. ** This api can return two different sets of information about current playback status.
  139. **
  140. ** If mode = 0 then it will return the position (in ms) of the currently playing track.
  141. ** Will return -1 if Winamp is not playing.
  142. **
  143. ** If mode = 1 then it will return the current track length (in seconds).
  144. ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
  145. **
  146. ** If mode = 2 then it will return the current track length (in milliseconds).
  147. ** Will return -1 if there are no tracks (or possibly if Winamp cannot get the length).
  148. */
  149. #define IPC_JUMPTOTIME 106
  150. /* (requires Winamp 1.60+)
  151. ** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
  152. ** This api sets the current position (in milliseconds) for the currently playing song.
  153. ** The resulting playback position may only be an approximate time since some playback
  154. ** formats do not provide exact seeking e.g. mp3
  155. ** This returns -1 if Winamp is not playing, 1 on end of file, or 0 if it was successful.
  156. */
  157. #define IPC_GETMODULENAME 109
  158. #define IPC_EX_ISRIGHTEXE 666
  159. /* usually shouldnt bother using these, but here goes:
  160. ** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal
  161. ** flag gets set, which if you send a normal WM_WA_IPC message with
  162. ** IPC_EX_ISRIGHTEXE, it returns whether or not that filename
  163. ** matches. lame, I know.
  164. */
  165. #define IPC_WRITEPLAYLIST 120
  166. /* (requires Winamp 1.666+)
  167. ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_WRITEPLAYLIST);
  168. **
  169. ** IPC_WRITEPLAYLIST will write the current playlist to '<winampdir>\\Winamp.m3u' and
  170. ** will also return the current playlist position (see IPC_GETLISTPOS).
  171. **
  172. ** This is kinda obsoleted by some of the newer 2.x api items but it still is good for
  173. ** use with a front-end program (instead of a plug-in) and you want to see what is in the
  174. ** current playlist.
  175. **
  176. ** This api will only save out extended file information in the #EXTINF entry if Winamp
  177. ** has already read the data such as if the file was played of scrolled into view. If
  178. ** Winamp has not read the data then you will only find the file with its filepath entry
  179. ** (as is the base requirements for a m3u playlist).
  180. */
  181. #define IPC_SETPLAYLISTPOS 121
  182. /* (requires Winamp 2.0+)
  183. ** SendMessage(hwnd_winamp,WM_WA_IPC,position,IPC_SETPLAYLISTPOS)
  184. ** IPC_SETPLAYLISTPOS sets the playlist position to the specified 'position'.
  185. ** It will not change playback status or anything else. It will just set the current
  186. ** position in the playlist and will update the playlist view if necessary.
  187. **
  188. ** If you use SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_BUTTON2,0),0);
  189. ** after using IPC_SETPLAYLISTPOS then Winamp will start playing the file at 'position'.
  190. */
  191. #define IPC_SETVOLUME 122
  192. /* (requires Winamp 2.0+)
  193. ** SendMessage(hwnd_winamp,WM_WA_IPC,volume,IPC_SETVOLUME);
  194. ** IPC_SETVOLUME sets the volume of Winamp (between the range of 0 to 255).
  195. **
  196. ** If you pass 'volume' as -666 then the message will return the current volume.
  197. ** int curvol = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME);
  198. */
  199. #define IPC_GETVOLUME(hwnd_winamp) SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETVOLUME)
  200. /* (requires Winamp 2.0+)
  201. ** int curvol = IPC_GETVOLUME(hwnd_winamp);
  202. ** This will return the current volume of Winamp or
  203. */
  204. #define IPC_SETPANNING 123
  205. /* (requires Winamp 2.0+)
  206. ** SendMessage(hwnd_winamp,WM_WA_IPC,panning,IPC_SETPANNING);
  207. ** IPC_SETPANNING sets the panning of Winamp from 0 (left) to 255 (right).
  208. **
  209. ** At least in 5.x+ this works from -127 (left) to 127 (right).
  210. **
  211. ** If you pass 'panning' as -666 to this api then it will return the current panning.
  212. ** int curpan = SendMessage(hwnd_winamp,WM_WA_IPC,-666,IPC_SETPANNING);
  213. */
  214. #define IPC_GETLISTLENGTH 124
  215. /* (requires Winamp 2.0+)
  216. ** int length = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTLENGTH);
  217. ** IPC_GETLISTLENGTH returns the length of the current playlist as the number of tracks.
  218. */
  219. #define IPC_GETLISTPOS 125
  220. /* (requires Winamp 2.05+)
  221. ** int pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
  222. ** IPC_GETLISTPOS returns the current playlist position (which is shown in the playlist
  223. ** editor as a differently coloured text entry e.g is yellow for the classic skin).
  224. **
  225. ** This api is a lot like IPC_WRITEPLAYLIST but a lot faster since it does not have to
  226. ** write out the whole of the current playlist first.
  227. */
  228. #define IPC_GETINFO 126
  229. /* (requires Winamp 2.05+)
  230. ** int inf=SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETINFO);
  231. ** IPC_GETINFO returns info about the current playing song. The value
  232. ** it returns depends on the value of 'mode'.
  233. ** Mode Meaning
  234. ** ------------------
  235. ** 0 Samplerate, in kilohertz (i.e. 44)
  236. ** 1 Bitrate (i.e. 128)
  237. ** 2 Channels (i.e. 2)
  238. ** 3 (5+) Video LOWORD=w HIWORD=h
  239. ** 4 (5+) > 65536, string (video description)
  240. ** 5 (5.25+) Samplerate, in hertz (i.e. 44100)
  241. */
  242. #define IPC_GETEQDATA 127
  243. /* (requires Winamp 2.05+)
  244. ** int data=SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
  245. ** IPC_GETEQDATA queries the status of the EQ.
  246. ** The value returned depends on what 'pos' is set to:
  247. ** Value Meaning
  248. ** ------------------
  249. ** 0-9 The 10 bands of EQ data. 0-63 (+20db - -20db)
  250. ** 10 The preamp value. 0-63 (+20db - -20db)
  251. ** 11 Enabled. zero if disabled, nonzero if enabled.
  252. ** 12 Autoload. zero if disabled, nonzero if enabled.
  253. */
  254. #define IPC_SETEQDATA 128
  255. /* (requires Winamp 2.05+)
  256. ** SendMessage(hwnd_winamp,WM_WA_IPC,pos,IPC_GETEQDATA);
  257. ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SETEQDATA);
  258. ** IPC_SETEQDATA sets the value of the last position retrieved
  259. ** by IPC_GETEQDATA. This is pretty lame, and we should provide
  260. ** an extended version that lets you do a MAKELPARAM(pos,value).
  261. ** someday...
  262. new (2.92+):
  263. if the high byte is set to 0xDB, then the third byte specifies
  264. which band, and the bottom word specifies the value.
  265. */
  266. #define IPC_ADDBOOKMARK 129
  267. #define IPC_ADDBOOKMARKW 131
  268. /* (requires Winamp 2.4+)
  269. ** This is sent as a WM_COPYDATA using IPC_ADDBOOKMARK as the dwData value and the
  270. ** directory you want to change to as the lpData member. This will add the specified
  271. ** file / url to the Winamp bookmark list.
  272. **
  273. ** COPYDATASTRUCT cds = {0};
  274. ** cds.dwData = IPC_ADDBOOKMARK;
  275. ** cds.lpData = (void*)"http://www.blah.com/listen.pls";
  276. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  277. ** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  278. **
  279. **
  280. ** In Winamp 5.0+ we use this as a normal WM_WA_IPC and the string is null separated as
  281. ** the filename and then the title of the entry.
  282. **
  283. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)"filename\0title\0",IPC_ADDBOOKMARK);
  284. **
  285. ** This will notify the library / bookmark editor that a bookmark was added.
  286. ** Note that using this message in this context does not actually add the bookmark.
  287. ** Do not use, it is essentially just a notification type message :)
  288. */
  289. #define IPC_INSTALLPLUGIN 130
  290. /* This is not implemented (and is very unlikely to be done due to safety concerns).
  291. ** If it was then you could do a WM_COPYDATA with a path to a .wpz and it would then
  292. ** install the plugin for you.
  293. **
  294. ** COPYDATASTRUCT cds = {0};
  295. ** cds.dwData = IPC_INSTALLPLUGIN;
  296. ** cds.lpData = (void*)"c:\\path\\to\\file.wpz";
  297. ** cds.cbData = lstrlen((char*)cds.lpData)+1; // include space for null char
  298. ** SendMessage(hwnd_winamp,WM_COPYDATA,0,(LPARAM)&cds);
  299. */
  300. #define IPC_RESTARTWINAMP 135
  301. /* (requires Winamp 2.2+)
  302. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_RESTARTWINAMP);
  303. ** IPC_RESTARTWINAMP will restart Winamp (isn't that obvious ? :) )
  304. ** If this fails to make Winamp start after closing then there is a good chance one (or
  305. ** more) of the currently installed plugins caused Winamp to crash on exit (either as a
  306. ** silent crash or a full crash log report before it could call itself start again.
  307. */
  308. #define IPC_ISFULLSTOP 400
  309. /* (requires winamp 2.7+ I think)
  310. ** int ret=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISFULLSTOP);
  311. ** This is useful for when you're an output plugin and you want to see if the stop/close
  312. ** happening is a full stop or if you are just between tracks. This returns non zero if
  313. ** it is a full stop or zero if it is just a new track.
  314. ** benski> i think it's actually the other way around -
  315. ** !0 for EOF and 0 for user pressing stop
  316. */
  317. #define IPC_INETAVAILABLE 242
  318. /* (requires Winamp 2.05+)
  319. ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INETAVAILABLE);
  320. ** IPC_INETAVAILABLE will return 1 if an Internet connection is available for Winamp and
  321. ** relates to the internet connection type setting on the main general preferences page
  322. ** in the Winamp preferences.
  323. */
  324. #define IPC_UPDTITLE 243
  325. /* (requires Winamp 2.2+)
  326. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_UPDTITLE);
  327. ** IPC_UPDTITLE will ask Winamp to update the information about the current title and
  328. ** causes GetFileInfo(..) in the input plugin associated with the current playlist entry
  329. ** to be called. This can be called such as when an input plugin is buffering a file so
  330. ** that it can cause the buffer percentage to appear in the playlist.
  331. */
  332. #define IPC_REFRESHPLCACHE 247
  333. /* (requires Winamp 2.2+)
  334. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REFRESHPLCACHE);
  335. ** IPC_REFRESHPLCACHE will flush the playlist cache buffer and you send this if you want
  336. ** Winamp to go refetch the titles for all of the entries in the current playlist.
  337. **
  338. ** 5.3+: pass a wchar_t * string in wParam, and it'll do a strnicmp() before clearing the cache
  339. */
  340. #define IPC_GET_SHUFFLE 250
  341. /* (requires Winamp 2.4+)
  342. ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_SHUFFLE);
  343. ** IPC_GET_SHUFFLE returns the status of the shuffle option.
  344. ** If set then it will return 1 and if not set then it will return 0.
  345. */
  346. #define IPC_GET_REPEAT 251
  347. /* (requires Winamp 2.4+)
  348. ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_REPEAT);
  349. ** IPC_GET_REPEAT returns the status of the repeat option.
  350. ** If set then it will return 1 and if not set then it will return 0.
  351. */
  352. #define IPC_SET_SHUFFLE 252
  353. /* (requires Winamp 2.4+)
  354. ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_SHUFFLE);
  355. ** IPC_SET_SHUFFLE sets the status of the shuffle option.
  356. ** If 'value' is 1 then shuffle is turned on.
  357. ** If 'value' is 0 then shuffle is turned off.
  358. */
  359. #define IPC_SET_REPEAT 253
  360. /* (requires Winamp 2.4+)
  361. ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_REPEAT);
  362. ** IPC_SET_REPEAT sets the status of the repeat option.
  363. ** If 'value' is 1 then shuffle is turned on.
  364. ** If 'value' is 0 then shuffle is turned off.
  365. */
  366. #define IPC_ENABLEDISABLE_ALL_WINDOWS 259 // 0xdeadbeef to disable
  367. /* (requires Winamp 2.9+)
  368. ** SendMessage(hwnd_winamp,WM_WA_IPC,(enable?0:0xdeadbeef),IPC_ENABLEDISABLE_ALL_WINDOWS);
  369. ** Sending this message with 0xdeadbeef as the param will disable all winamp windows and
  370. ** any other values will enable all of the Winamp windows again. When disabled you won't
  371. ** get any response on clicking or trying to do anything to the Winamp windows. If the
  372. ** taskbar icon is shown then you may still have control ;)
  373. */
  374. #define IPC_GETWND 260
  375. /* (requires Winamp 2.9+)
  376. ** HWND h=SendMessage(hwnd_winamp,WM_WA_IPC,IPC_GETWND_xxx,IPC_GETWND);
  377. ** returns the HWND of the window specified.
  378. */
  379. #define IPC_GETWND_EQ 0 // use one of these for the param
  380. #define IPC_GETWND_PE 1
  381. #define IPC_GETWND_MB 2
  382. #define IPC_GETWND_VIDEO 3
  383. #define IPC_ISWNDVISIBLE 261 // same param as IPC_GETWND
  384. /************************************************************************
  385. ***************** in-process only (WE LOVE PLUGINS)
  386. ************************************************************************/
  387. #define IPC_SETSKINW 199
  388. #define IPC_SETSKIN 200
  389. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  390. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"skinname",IPC_SETSKIN);
  391. ** IPC_SETSKIN sets the current skin to "skinname". Note that skinname
  392. ** can be the name of a skin, a skin .zip file, with or without path.
  393. ** If path isn't specified, the default search path is the winamp skins
  394. ** directory.
  395. */
  396. #define IPC_GETSKIN 201
  397. #define IPC_GETSKINW 1201
  398. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  399. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)skinname_buffer,IPC_GETSKIN);
  400. ** IPC_GETSKIN puts the directory where skin bitmaps can be found
  401. ** into skinname_buffer.
  402. ** skinname_buffer must be MAX_PATH characters in length.
  403. ** When using a .zip'd skin file, it'll return a temporary directory
  404. ** where the ZIP was decompressed.
  405. */
  406. #define IPC_EXECPLUG 202
  407. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  408. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)"vis_file.dll",IPC_EXECPLUG);
  409. ** IPC_EXECPLUG executes a visualization plug-in pointed to by WPARAM.
  410. ** the format of this string can be:
  411. ** "vis_whatever.dll"
  412. ** "vis_whatever.dll,0" // (first mod, file in winamp plug-in dir)
  413. ** "C:\\dir\\vis_whatever.dll,1"
  414. */
  415. #define IPC_GETPLAYLISTFILE 211
  416. #define IPC_GETPLAYLISTFILEW 214
  417. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  418. ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTFILE);
  419. ** IPC_GETPLAYLISTFILE gets the filename of the playlist entry [index].
  420. ** returns a pointer to it. returns NULL on error.
  421. */
  422. #define IPC_GETPLAYLISTTITLE 212
  423. #define IPC_GETPLAYLISTTITLEW 213
  424. /* (requires Winamp 2.04+, only usable from plug-ins (not external apps))
  425. ** char *name=SendMessage(hwnd_winamp,WM_WA_IPC,index,IPC_GETPLAYLISTTITLE);
  426. **
  427. ** IPC_GETPLAYLISTTITLE gets the title of the playlist entry [index].
  428. ** returns a pointer to it. returns NULL on error.
  429. */
  430. #define IPC_GETHTTPGETTER 240
  431. /* retrieves a function pointer to a HTTP retrieval function.
  432. ** if this is unsupported, returns 1 or 0.
  433. ** the function should be:
  434. ** int (*httpRetrieveFile)(HWND hwnd, char *url, char *file, char *dlgtitle);
  435. ** if you call this function, with a parent window, a URL, an output file, and a dialog title,
  436. ** it will return 0 on successful download, 1 on error.
  437. */
  438. #define IPC_GETHTTPGETTERW 1240
  439. /* int (*httpRetrieveFileW)(HWND hwnd, char *url, wchar_t *file, wchar_t *dlgtitle); */
  440. #define IPC_MBOPEN 241
  441. /* (requires Winamp 2.05+)
  442. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_MBOPEN);
  443. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPEN);
  444. ** IPC_MBOPEN will open a new URL in the minibrowser. if url is NULL, it will open the Minibrowser window.
  445. */
  446. #define IPC_CHANGECURRENTFILE 245
  447. /* (requires Winamp 2.05+)
  448. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILE);
  449. ** IPC_CHANGECURRENTFILE will set the current playlist item.
  450. */
  451. #define IPC_CHANGECURRENTFILEW 1245
  452. /* (requires Winamp 5.3+)
  453. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)file,IPC_CHANGECURRENTFILEW);
  454. ** IPC_CHANGECURRENTFILEW will set the current playlist item.
  455. */
  456. #define IPC_GETMBURL 246
  457. /* (requires Winamp 2.2+)
  458. ** char buffer[4096]; // Urls can be VERY long
  459. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)buffer,IPC_GETMBURL);
  460. ** IPC_GETMBURL will retrieve the current Minibrowser URL into buffer.
  461. ** buffer must be at least 4096 bytes long.
  462. */
  463. #define IPC_MBBLOCK 248
  464. /* (requires Winamp 2.4+)
  465. ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_MBBLOCK);
  466. **
  467. ** IPC_MBBLOCK will block the Minibrowser from updates if value is set to 1
  468. */
  469. #define IPC_MBOPENREAL 249
  470. /* (requires Winamp 2.4+)
  471. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)url,IPC_MBOPENREAL);
  472. **
  473. ** IPC_MBOPENREAL works the same as IPC_MBOPEN except that it will works even if
  474. ** IPC_MBBLOCK has been set to 1
  475. */
  476. #define IPC_ADJUST_OPTIONSMENUPOS 280
  477. /* (requires Winamp 2.9+)
  478. ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_OPTIONSMENUPOS);
  479. ** moves where winamp expects the Options menu in the main menu. Useful if you wish to insert a
  480. ** menu item above the options/skins/vis menus.
  481. */
  482. #define IPC_GET_HMENU 281
  483. /* (requires Winamp 2.9+)
  484. ** HMENU hMenu=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0,IPC_GET_HMENU);
  485. ** values for data:
  486. ** 0 : main popup menu
  487. ** 1 : main menubar file menu
  488. ** 2 : main menubar options menu
  489. ** 3 : main menubar windows menu
  490. ** 4 : main menubar help menu
  491. ** other values will return NULL.
  492. */
  493. #define IPC_GET_EXTENDED_FILE_INFO 290 //pass a pointer to the following struct in wParam
  494. #define IPC_GET_EXTENDED_FILE_INFO_HOOKABLE 296
  495. /* (requires Winamp 2.9+)
  496. ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
  497. ** filename and metadata field you wish to query, and ret to a buffer, with retlen to the
  498. ** length of that buffer, and then SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_GET_EXTENDED_FILE_INFO);
  499. ** the results should be in the buffer pointed to by ret.
  500. ** returns 1 if the decoder supports a getExtendedFileInfo method
  501. */
  502. typedef struct {
  503. const char *filename;
  504. const char *metadata;
  505. char *ret;
  506. size_t retlen;
  507. } extendedFileInfoStruct;
  508. #define IPC_GET_BASIC_FILE_INFO 291 //pass a pointer to the following struct in wParam
  509. typedef struct {
  510. const char *filename;
  511. int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
  512. // filled in by winamp
  513. int length;
  514. char *title;
  515. int titlelen;
  516. } basicFileInfoStruct;
  517. #define IPC_GET_BASIC_FILE_INFOW 1291 //pass a pointer to the following struct in wParam
  518. typedef struct {
  519. const wchar_t *filename;
  520. int quickCheck; // set to 0 to always get, 1 for quick, 2 for default (if 2, quickCheck will be set to 0 if quick wasnot used)
  521. // filled in by winamp
  522. int length;
  523. wchar_t *title;
  524. int titlelen;
  525. } basicFileInfoStructW;
  526. #define IPC_GET_EXTLIST 292 //returns doublenull delimited. GlobalFree() it when done. if data is 0, returns raw extlist, if 1, returns something suitable for getopenfilename
  527. #define IPC_GET_EXTLISTW 1292 // wide char version of above
  528. #define IPC_INFOBOX 293
  529. typedef struct {
  530. HWND parent;
  531. char *filename;
  532. } infoBoxParam;
  533. #define IPC_INFOBOXW 1293
  534. typedef struct {
  535. HWND parent;
  536. const wchar_t *filename;
  537. } infoBoxParamW;
  538. #define IPC_SET_EXTENDED_FILE_INFO 294 //pass a pointer to the a extendedFileInfoStruct in wParam
  539. /* (requires Winamp 2.9+)
  540. ** to use, create an extendedFileInfoStruct, point the values filename and metadata to the
  541. ** filename and metadata field you wish to write in ret. (retlen is not used). and then
  542. ** SendMessage(hwnd_winamp,WM_WA_IPC,&struct,IPC_SET_EXTENDED_FILE_INFO);
  543. ** returns 1 if the metadata is supported
  544. ** Call IPC_WRITE_EXTENDED_FILE_INFO once you're done setting all the metadata you want to update
  545. */
  546. #define IPC_WRITE_EXTENDED_FILE_INFO 295
  547. /* (requires Winamp 2.9+)
  548. ** writes all the metadata set thru IPC_SET_EXTENDED_FILE_INFO to the file
  549. ** returns 1 if the file has been successfully updated, 0 if error
  550. */
  551. #define IPC_FORMAT_TITLE 297
  552. typedef struct
  553. {
  554. char *spec; // NULL=default winamp spec
  555. void *p;
  556. char *out;
  557. int out_len;
  558. char * (*TAGFUNC)(const char * tag, void * p); //return 0 if not found
  559. void (*TAGFREEFUNC)(char * tag,void * p);
  560. } waFormatTitle;
  561. #define IPC_FORMAT_TITLE_EXTENDED 298 // similiar to IPC_FORMAT_TITLE, but falls back to Winamp's %tags% if your passed tag function doesn't handle it
  562. typedef struct
  563. {
  564. const wchar_t *filename;
  565. int useExtendedInfo; // set to 1 if you want the Title Formatter to query the input plugins for any tags that your tag function fails on
  566. const wchar_t *spec; // NULL=default winamp spec
  567. void *p;
  568. wchar_t *out;
  569. int out_len;
  570. wchar_t * (*TAGFUNC)(const wchar_t * tag, void * p); //return 0 if not found, -1 for empty tag
  571. void (*TAGFREEFUNC)(wchar_t *tag, void *p);
  572. } waFormatTitleExtended;
  573. #define IPC_COPY_EXTENDED_FILE_INFO 299
  574. typedef struct
  575. {
  576. const char *source;
  577. const char *dest;
  578. } copyFileInfoStruct;
  579. #define IPC_COPY_EXTENDED_FILE_INFOW 1299
  580. typedef struct
  581. {
  582. const wchar_t *source;
  583. const wchar_t *dest;
  584. } copyFileInfoStructW;
  585. typedef struct {
  586. int (*inflateReset)(void *strm);
  587. int (*inflateInit_)(void *strm,const char *version, int stream_size);
  588. int (*inflate)(void *strm, int flush);
  589. int (*inflateEnd)(void *strm);
  590. unsigned long (*crc32)(unsigned long crc, const unsigned char *buf, unsigned int len);
  591. } wa_inflate_struct;
  592. #define IPC_GETUNCOMPRESSINTERFACE 331
  593. /* returns a function pointer to uncompress().
  594. ** int (*uncompress)(unsigned char *dest, unsigned long *destLen, const unsigned char *source, unsigned long sourceLen);
  595. ** right out of zlib, useful for decompressing zlibbed data.
  596. ** if you pass the parm of 0x10100000, it will return a wa_inflate_struct * to an inflate API.
  597. */
  598. typedef struct _prefsDlgRec {
  599. HINSTANCE hInst; // dll instance containing the dialog resource
  600. int dlgID; // resource identifier of the dialog
  601. void *proc; // window proceedure for handling the dialog defined as
  602. // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
  603. char *name; // name shown for the prefs page in the treelist
  604. intptr_t where; // section in the treelist the prefs page is to be added to
  605. // 0 for General Preferences
  606. // 1 for Plugins
  607. // 2 for Skins
  608. // 3 for Bookmarks (no longer in the 5.0+ prefs)
  609. // 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
  610. intptr_t _id;
  611. struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
  612. } prefsDlgRec;
  613. typedef struct _prefsDlgRecW {
  614. HINSTANCE hInst; // dll instance containing the dialog resource
  615. int dlgID; // resource identifier of the dialog
  616. void *proc; // window proceedure for handling the dialog defined as
  617. // LRESULT CALLBACK PrefsPage(HWND,UINT,WPARAM,LPARAM)
  618. wchar_t *name; // name shown for the prefs page in the treelist
  619. intptr_t where; // section in the treelist the prefs page is to be added to
  620. // 0 for General Preferences
  621. // 1 for Plugins
  622. // 2 for Skins
  623. // 3 for Bookmarks (no longer in the 5.0+ prefs)
  624. // 4 for Prefs (the old 'Setup' section - no longer in 5.0+)
  625. intptr_t _id;
  626. struct _prefsDlgRec *next; // no longer implemented as a linked list, now used by Winamp for other means
  627. } prefsDlgRecW;
  628. #define IPC_ADD_PREFS_DLG 332
  629. #define IPC_ADD_PREFS_DLGW 1332
  630. #define IPC_REMOVE_PREFS_DLG 333
  631. /* (requires Winamp 2.9+)
  632. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  633. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
  634. **
  635. ** IPC_ADD_PREFS_DLG:
  636. ** To use this you need to allocate a prefsDlgRec structure (either on the heap or with
  637. ** some global data but NOT on the stack) and then initialise the members of the structure
  638. ** (see the definition of the prefsDlgRec structure above).
  639. **
  640. ** hInst - dll instance of where the dialog resource is located.
  641. ** dlgID - id of the dialog resource.
  642. ** proc - dialog window procedure for the prefs dialog.
  643. ** name - name of the prefs page as shown in the preferences list.
  644. ** where - see above for the valid locations the page can be added.
  645. **
  646. ** Then you do SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  647. **
  648. ** example:
  649. **
  650. ** prefsDlgRec* prefsRec = 0;
  651. ** prefsRec = GlobalAlloc(GPTR,sizeof(prefsDlgRec));
  652. ** prefsRec->hInst = hInst;
  653. ** prefsRec->dlgID = IDD_PREFDIALOG;
  654. ** prefsRec->name = "Pref Page";
  655. ** prefsRec->where = 0;
  656. ** prefsRec->proc = PrefsPage;
  657. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_ADD_PREFS_DLG);
  658. **
  659. **
  660. ** IPC_REMOVE_PREFS_DLG:
  661. ** To use you pass the address of the same prefsRec you used when adding the prefs page
  662. ** though you shouldn't really ever have to do this but it's good to clean up after you
  663. ** when you're plugin is being unloaded.
  664. **
  665. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_REMOVE_PREFS_DLG);
  666. **
  667. ** IPC_ADD_PREFS_DLGW
  668. ** requires Winamp 5.53+
  669. */
  670. #define IPC_OPENPREFSTOPAGE 380
  671. /* SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&prefsRec,IPC_OPENPREFSTOPAGE);
  672. **
  673. ** There are two ways of opening a preferences page.
  674. **
  675. ** The first is to pass an id of a builtin preferences page (see below for ids) or a
  676. ** &prefsDlgRec of the preferences page to open and this is normally done if you are
  677. ** opening a prefs page you added yourself.
  678. **
  679. ** If the page id does not or the &prefsRec is not valid then the prefs dialog will be
  680. ** opened to the first page available (usually the Winamp Pro page).
  681. **
  682. ** (requires Winamp 5.04+)
  683. ** Passing -1 for param will open the preferences dialog to the last page viewed.
  684. **
  685. ** Note: v5.0 to 5.03 had a bug in this api
  686. **
  687. ** On the first call then the correct prefs page would be opened to but on the next call
  688. ** the prefs dialog would be brought to the front but the page would not be changed to the
  689. ** specified.
  690. ** In 5.04+ it will change to the prefs page specified if the prefs dialog is already open.
  691. */
  692. /* Builtin Preference page ids (valid for 5.0+)
  693. ** (stored in the lParam member of the TVITEM structure from the tree item)
  694. **
  695. ** These can be useful if you want to detect a specific prefs page and add things to it
  696. ** yourself or something like that ;)
  697. **
  698. ** Winamp Pro 20
  699. ** General Preferences 0
  700. ** File Types 1
  701. ** Playlist 23
  702. ** Titles 21
  703. ** Playback 42 (added in 5.25)
  704. ** Station Info 41 (added in 5.11 & removed in 5.5)
  705. ** Video 24
  706. ** Localization 25 (added in 5.5)
  707. ** Skins 40
  708. ** Classic Skins 22
  709. ** Plugins 30
  710. ** Input 31
  711. ** Output 32
  712. ** Visualisation 33
  713. ** DSP/Effect 34
  714. ** General Purpose 35
  715. **
  716. ** Note:
  717. ** Custom page ids begin from 60
  718. ** The value of the normal custom pages (Global Hotkeys, Jump To File, etc) is not
  719. ** guaranteed since it depends on the order in which the plugins are loaded which can
  720. ** change on different systems.
  721. **
  722. ** Global Hotkeys, Jump To File, Media Library (under General Preferences and child pages),
  723. ** Media Library (under Plugins), Portables, CD Ripping and Modern Skins are custom pages
  724. ** created by the plugins shipped with Winamp.
  725. */
  726. #define IPC_GETINIFILE 334
  727. /* (requires Winamp 2.9+)
  728. ** char *ini=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE);
  729. ** This returns a pointer to the full file path of winamp.ini.
  730. **
  731. ** char ini_path[MAX_PATH] = {0};
  732. **
  733. ** void GetIniFilePath(HWND hwnd){
  734. ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION) >= 0x2900){
  735. ** // this gets the string of the full ini file path
  736. ** lstrcpyn(ini_path,(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIFILE),sizeof(ini_path));
  737. ** }
  738. ** else{
  739. ** char* p = ini_path;
  740. ** p += GetModuleFileName(0,ini_path,sizeof(ini_path)) - 1;
  741. ** while(p && *p != '.'){p--;}
  742. ** lstrcpyn(p+1,"ini",sizeof(ini_path));
  743. ** }
  744. ** }
  745. */
  746. #define IPC_GETINIDIRECTORY 335
  747. /* (requires Winamp 2.9+)
  748. ** char *dir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETINIDIRECTORY);
  749. ** This returns a pointer to the directory where winamp.ini can be found and is
  750. ** useful if you want store config files but you don't want to use winamp.ini.
  751. */
  752. #define IPC_GETPLUGINDIRECTORY 336
  753. /* (requires Winamp 5.11+)
  754. ** char *plugdir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPLUGINDIRECTORY);
  755. ** This returns a pointer to the directory where Winamp has its plugins stored and is
  756. ** useful if you want store config files in plugins.ini in the plugins folder or for
  757. ** accessing any local files in the plugins folder.
  758. */
  759. #define IPC_GETM3UDIRECTORY 337
  760. /* (requires Winamp 5.11+)
  761. ** char *m3udir=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORY);
  762. ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
  763. */
  764. #define IPC_GETM3UDIRECTORYW 338
  765. /* (requires Winamp 5.3+)
  766. ** wchar_t *m3udirW=(wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETM3UDIRECTORYW);
  767. ** This returns a pointer to the directory where winamp.m3u (and winamp.m3u8 if supported) is stored in.
  768. */
  769. #define IPC_SPAWNBUTTONPOPUP 361 // param =
  770. // 0 = eject
  771. // 1 = previous
  772. // 2 = next
  773. // 3 = pause
  774. // 4 = play
  775. // 5 = stop
  776. #define IPC_OPENURLBOX 360
  777. /* (requires Winamp 5.0+)
  778. ** HGLOBAL hglobal = (HGLOBAL)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENURLBOX);
  779. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  780. ** This will return a HGLOBAL that needs to be freed with GlobalFree() if this worked.
  781. */
  782. #define IPC_OPENFILEBOX 362
  783. /* (requires Winamp 5.0+)
  784. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENFILEBOX);
  785. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  786. */
  787. #define IPC_OPENDIRBOX 363
  788. /* (requires Winamp 5.0+)
  789. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_OPENDIRBOX);
  790. ** You pass a hwnd for the dialog to be parented to (which modern skin support uses).
  791. */
  792. #define IPC_SETDIALOGBOXPARENT 364
  793. /* (requires Winamp 5.0+)
  794. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)parent,IPC_SETDIALOGBOXPARENT);
  795. ** Pass 'parent' as the window which will be used as the parent for a number of the built
  796. ** in Winamp dialogs and is useful when you are taking over the whole of the UI so that
  797. ** the dialogs will not appear at the bottom right of the screen since the main winamp
  798. ** window is located at 3000x3000 by gen_ff when this is used. Call this again with
  799. ** parent = null to reset the parent back to the orginal Winamp window.
  800. */
  801. #define IPC_GETDIALOGBOXPARENT 365
  802. /* (requires Winamp 5.51+)
  803. ** HWND hwndParent = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)0, IPC_GETDIALOGBOXPARENT);
  804. ** hwndParent can/must be passed to all modal dialogs (including MessageBox) thats uses winamp as a parent
  805. */
  806. #define IPC_UPDATEDIALOGBOXPARENT 366
  807. /* (requires Winamp 5.53+)
  808. ** if you previous called IPC_SETDIALOGBOXPARENT, call this every time your window resizes
  809. */
  810. #define IPC_DRO_MIN 401 // reserved for DrO
  811. #define IPC_SET_JTF_COMPARATOR 409
  812. /* pass me an int (__cdecl *)(const char *, const char *) in wParam */
  813. #define IPC_SET_JTF_COMPARATOR_W 410
  814. /* pass me an int (__cdecl *)(const wchar_t *, const wchar_t *) in wParam ... maybe someday :) */
  815. #define IPC_SET_JTF_DRAWTEXT 416
  816. #define IPC_DRO_MAX 499
  817. // pass 0 for a copy of the skin HBITMAP
  818. // pass 1 for name of font to use for playlist editor likeness
  819. // pass 2 for font charset
  820. // pass 3 for font size
  821. #define IPC_GET_GENSKINBITMAP 503
  822. typedef struct
  823. {
  824. HWND me; //hwnd of the window
  825. #define EMBED_FLAGS_NORESIZE 0x1
  826. // set this bit to keep window from being resizable
  827. #define EMBED_FLAGS_NOTRANSPARENCY 0x2
  828. // set this bit to make gen_ff turn transparency off for this window
  829. #define EMBED_FLAGS_NOWINDOWMENU 0x4
  830. // set this bit to prevent gen_ff from automatically adding your window to the right-click menu
  831. #define EMBED_FLAGS_GUID 0x8
  832. // (5.31+) call SET_EMBED_GUID(yourEmbedWindowStateStruct, GUID) to define a GUID for this window
  833. #define SET_EMBED_GUID(windowState, windowGUID) { windowState->flags |= EMBED_FLAGS_GUID; *((GUID *)&windowState->extra_data[4])=windowGUID; }
  834. #define GET_EMBED_GUID(windowState) (*((GUID *)&windowState->extra_data[4]))
  835. int flags; // see above
  836. RECT r;
  837. void *user_ptr; // for application use
  838. int extra_data[64]; // for internal winamp use
  839. } embedWindowState;
  840. #define IPC_GET_EMBEDIF 505
  841. /* (requires Winamp 2.9+)
  842. ** HWND myframe = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&wa_wnd,IPC_GET_EMBEDIF);
  843. **
  844. ** or
  845. **
  846. ** HWND myframe = 0;
  847. ** HWND (*embed)(embedWindowState *params)=0;
  848. ** *(void**)&embed = (void*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_EMBEDIF);
  849. ** myframe = embed(&wa_wnd);
  850. **
  851. ** You pass an embedWindowState* and it will return a hwnd for the frame window or if you
  852. ** pass wParam as null then it will return a HWND embedWindow(embedWindowState *);
  853. */
  854. #define IPC_SKINWINDOW 534
  855. typedef struct __SKINWINDOWPARAM
  856. {
  857. HWND hwndToSkin;
  858. GUID windowGuid;
  859. } SKINWINDOWPARAM;
  860. #define IPC_EMBED_ENUM 532
  861. typedef struct embedEnumStruct
  862. {
  863. int (*enumProc)(embedWindowState *ws, struct embedEnumStruct *param); // return 1 to abort
  864. int user_data; // or more :)
  865. } embedEnumStruct;
  866. // pass
  867. #define IPC_EMBED_ISVALID 533
  868. /* (requires Winamp 2.9+)
  869. ** int valid = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)embedhwnd,IPC_EMBED_ISVALID);
  870. ** Pass a hwnd in the wParam to this to check if the hwnd is a valid embed window or not.
  871. */
  872. #define IPC_CONVERTFILE 506
  873. /* (requires Winamp 2.92+)
  874. ** Converts a given file to a different format (PCM, MP3, etc...)
  875. ** To use, pass a pointer to a waFileConvertStruct struct
  876. ** This struct can be either on the heap or some global
  877. ** data, but NOT on the stack. At least, until the conversion is done.
  878. **
  879. ** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE);
  880. **
  881. ** Return value:
  882. ** 0: Can't start the conversion. Look at myConvertStruct->error for details.
  883. ** 1: Conversion started. Status messages will be sent to the specified callbackhwnd.
  884. ** Be sure to call IPC_CONVERTFILE_END when your callback window receives the
  885. ** IPC_CB_CONVERT_DONE message.
  886. */
  887. typedef struct
  888. {
  889. char *sourcefile; // "c:\\source.mp3"
  890. char *destfile; // "c:\\dest.pcm"
  891. intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
  892. //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
  893. HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
  894. //filled in by winamp.exe
  895. char *error; //if IPC_CONVERTFILE returns 0, the reason will be here
  896. int bytes_done; //you can look at both of these values for speed statistics
  897. int bytes_total;
  898. int bytes_out;
  899. int killswitch; // don't set it manually, use IPC_CONVERTFILE_END
  900. intptr_t extra_data[64]; // for internal winamp use
  901. } convertFileStruct;
  902. #define IPC_CONVERTFILEW 515
  903. // (requires Winamp 5.36+)
  904. typedef struct
  905. {
  906. wchar_t *sourcefile; // "c:\\source.mp3"
  907. wchar_t *destfile; // "c:\\dest.pcm"
  908. intptr_t destformat[8]; // like 'PCM ',srate,nch,bps.
  909. //hack alert! you can set destformat[6]=mmioFOURCC('I','N','I',' '); and destformat[7]=(int)my_ini_file; (where my_ini_file is a char*)
  910. HWND callbackhwnd; // window that will receive the IPC_CB_CONVERT notification messages
  911. //filled in by winamp.exe
  912. wchar_t *error; //if IPC_CONVERTFILE returns 0, the reason will be here
  913. int bytes_done; //you can look at both of these values for speed statistics
  914. int bytes_total;
  915. int bytes_out;
  916. int killswitch; // don't set it manually, use IPC_CONVERTFILE_END
  917. intptr_t extra_data[64]; // for internal winamp use
  918. } convertFileStructW;
  919. #define IPC_CONVERTFILE_END 507
  920. /* (requires Winamp 2.92+)
  921. ** Stop/ends a convert process started from IPC_CONVERTFILE
  922. ** You need to call this when you receive the IPC_CB_CONVERTDONE message or when you
  923. ** want to abort a conversion process
  924. **
  925. ** eg: SendMessage(hwnd_winamp,WM_WA_IPC,&myConvertStruct,IPC_CONVERTFILE_END);
  926. **
  927. ** No return value
  928. */
  929. #define IPC_CONVERTFILEW_END 516
  930. // (requires Winamp 5.36+)
  931. typedef struct {
  932. HWND hwndParent;
  933. int format;
  934. //filled in by winamp.exe
  935. HWND hwndConfig;
  936. int extra_data[8];
  937. //hack alert! you can set extra_data[6]=mmioFOURCC('I','N','I',' '); and extra_data[7]=(int)my_ini_file; (where my_ini_file is a char*)
  938. } convertConfigStruct;
  939. #define IPC_CONVERT_CONFIG 508
  940. #define IPC_CONVERT_CONFIG_END 509
  941. typedef struct
  942. {
  943. void (*enumProc)(intptr_t user_data, const char *desc, int fourcc);
  944. intptr_t user_data;
  945. } converterEnumFmtStruct;
  946. #define IPC_CONVERT_CONFIG_ENUMFMTS 510
  947. /* (requires Winamp 2.92+)
  948. */
  949. typedef struct
  950. {
  951. char cdletter;
  952. char *playlist_file;
  953. HWND callback_hwnd;
  954. //filled in by winamp.exe
  955. char *error;
  956. } burnCDStruct;
  957. #define IPC_BURN_CD 511
  958. /* (requires Winamp 5.0+)
  959. */
  960. typedef struct
  961. {
  962. convertFileStruct *cfs;
  963. int priority;
  964. } convertSetPriority;
  965. #define IPC_CONVERT_SET_PRIORITY 512
  966. typedef struct
  967. {
  968. convertFileStructW *cfs;
  969. int priority;
  970. } convertSetPriorityW;
  971. #define IPC_CONVERT_SET_PRIORITYW 517
  972. // (requires Winamp 5.36+)
  973. typedef struct
  974. {
  975. unsigned int format; //fourcc value
  976. char *item; // config item, eg "bitrate"
  977. char *data; // buffer to recieve, or buffer that contains the data
  978. int len; // length of the data buffer (only used when getting a config item)
  979. char *configfile; // config file to read from
  980. } convertConfigItem;
  981. #define IPC_CONVERT_CONFIG_SET_ITEM 513 // returns TRUE if successful
  982. #define IPC_CONVERT_CONFIG_GET_ITEM 514 // returns TRUE if successful
  983. typedef struct
  984. {
  985. const char *filename;
  986. char *title; // 2048 bytes
  987. int length;
  988. int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
  989. } waHookTitleStruct;
  990. #define IPC_HOOK_TITLES 850
  991. /* (requires Winamp 5.0+)
  992. ** If you hook this message and modify the information then make sure to return TRUE.
  993. ** If you don't hook the message then make sure you pass it on through the subclass chain.
  994. **
  995. ** LRESULT CALLBACK WinampWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
  996. ** {
  997. ** LRESULT ret = CallWindowProc((WNDPROC)WinampProc,hwnd,umsg,wParam,lParam);
  998. **
  999. ** if(message==WM_WA_IPC && lParam==IPC_HOOK_TITLES)
  1000. ** {
  1001. ** waHookTitleStruct *ht = (waHookTitleStruct *) wParam;
  1002. ** // Doing ATF stuff with ht->title, whatever...
  1003. ** return TRUE;
  1004. ** }
  1005. ** return ret;
  1006. ** }
  1007. */
  1008. typedef struct
  1009. {
  1010. const wchar_t *filename;
  1011. wchar_t *title; // 2048 characters
  1012. int length;
  1013. int force_useformatting; // can set this to 1 if you want to force a url to use title formatting shit
  1014. } waHookTitleStructW;
  1015. #define IPC_HOOK_TITLESW 851
  1016. /* (requires Winamp 5.3+)
  1017. ** See information on IPC_HOOK_TITLES for how to process this.
  1018. */
  1019. #define IPC_GETSADATAFUNC 800
  1020. // 0: returns a char *export_sa_get() that returns 150 bytes of data
  1021. // 1: returns a export_sa_setreq(int want);
  1022. #define IPC_GETVUDATAFUNC 801
  1023. // 0: returns a int export_vu_get(int channel) that returns 0-255 (or -1 for bad channel)
  1024. #define IPC_ISMAINWNDVISIBLE 900
  1025. /* (requires Winamp 5.0+)
  1026. ** int visible=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISMAINWNDVISIBLE);
  1027. ** You send this to Winamp to query if the main window is visible or not such as by
  1028. ** unchecking the option in the main right-click menu. If the main window is visible then
  1029. ** this will return 1 otherwise it returns 0.
  1030. */
  1031. typedef struct
  1032. {
  1033. int numElems;
  1034. int *elems;
  1035. HBITMAP bm; // set if you want to override
  1036. } waSetPlColorsStruct;
  1037. #define IPC_SETPLEDITCOLORS 920
  1038. /* (requires Winamp 5.0+)
  1039. ** This is sent by gen_ff when a modern skin is being loaded to set the colour scheme for
  1040. ** the playlist editor. When sent numElems is usually 6 and matches with the 6 possible
  1041. ** colours which are provided be pledit.txt from the classic skins. The elems array is
  1042. ** defined as follows:
  1043. **
  1044. ** elems = 0 => normal text
  1045. ** elems = 1 => current text
  1046. ** elems = 2 => normal background
  1047. ** elems = 3 => selected background
  1048. ** elems = 4 => minibroswer foreground
  1049. ** elems = 5 => minibroswer background
  1050. **
  1051. ** if(uMsg == WM_WA_IPC && lParam == IPC_SETPLEDITCOLORS)
  1052. ** {
  1053. ** waSetPlColorsStruct* colStr = (waSetPlColorsStruct*)wp;
  1054. ** if(colStr)
  1055. ** {
  1056. ** // set or inspect the colours being used (basically for gen_ff's benefit)
  1057. ** }
  1058. ** }
  1059. */
  1060. typedef struct
  1061. {
  1062. HWND wnd;
  1063. int xpos; // in screen coordinates
  1064. int ypos;
  1065. } waSpawnMenuParms;
  1066. // waSpawnMenuParms2 is used by the menubar submenus
  1067. typedef struct
  1068. {
  1069. HWND wnd;
  1070. int xpos; // in screen coordinates
  1071. int ypos;
  1072. int width;
  1073. int height;
  1074. } waSpawnMenuParms2;
  1075. // the following IPC use waSpawnMenuParms as parameter
  1076. #define IPC_SPAWNEQPRESETMENU 933
  1077. #define IPC_SPAWNFILEMENU 934 //menubar
  1078. #define IPC_SPAWNOPTIONSMENU 935 //menubar
  1079. #define IPC_SPAWNWINDOWSMENU 936 //menubar
  1080. #define IPC_SPAWNHELPMENU 937 //menubar
  1081. #define IPC_SPAWNPLAYMENU 938 //menubar
  1082. #define IPC_SPAWNPEFILEMENU 939 //menubar
  1083. #define IPC_SPAWNPEPLAYLISTMENU 940 //menubar
  1084. #define IPC_SPAWNPESORTMENU 941 //menubar
  1085. #define IPC_SPAWNPEHELPMENU 942 //menubar
  1086. #define IPC_SPAWNMLFILEMENU 943 //menubar
  1087. #define IPC_SPAWNMLVIEWMENU 944 //menubar
  1088. #define IPC_SPAWNMLHELPMENU 945 //menubar
  1089. #define IPC_SPAWNPELISTOFPLAYLISTS 946
  1090. #define WM_WA_SYSTRAY WM_USER+1
  1091. /* This is sent by the system tray when an event happens (you might want to simulate it).
  1092. **
  1093. ** if(uMsg == WM_WA_SYSTRAY)
  1094. ** {
  1095. ** switch(lParam)
  1096. ** {
  1097. ** // process the messages sent from the tray
  1098. ** }
  1099. ** }
  1100. */
  1101. #define WM_WA_MPEG_EOF WM_USER+2
  1102. /* Input plugins send this when they are done playing back the current file to inform
  1103. ** Winamp or anyother installed plugins that the current
  1104. **
  1105. ** if(uMsg == WM_WA_MPEG_EOF)
  1106. ** {
  1107. ** // do what is needed here
  1108. ** }
  1109. */
  1110. //// video stuff
  1111. #define IPC_IS_PLAYING_VIDEO 501 // returns >1 if playing, 0 if not, 1 if old version (so who knows):)
  1112. #define IPC_GET_IVIDEOOUTPUT 500 // see below for IVideoOutput interface
  1113. #define VIDEO_MAKETYPE(A,B,C,D) ((A) | ((B)<<8) | ((C)<<16) | ((D)<<24))
  1114. #define VIDUSER_SET_INFOSTRING 0x1000
  1115. #define VIDUSER_GET_VIDEOHWND 0x1001
  1116. #define VIDUSER_SET_VFLIP 0x1002
  1117. #define VIDUSER_SET_TRACKSELINTERFACE 0x1003 // give your ITrackSelector interface as param2
  1118. #define VIDUSER_OPENVIDEORENDERER 0x1004
  1119. #define VIDUSER_CLOSEVIDEORENDERER 0x1005
  1120. #define VIDUSER_GETPOPUPMENU 0x1006
  1121. #define VIDUSER_SET_INFOSTRINGW 0x1007
  1122. typedef struct
  1123. {
  1124. int w;
  1125. int h;
  1126. int vflip;
  1127. double aspectratio;
  1128. unsigned int fmt;
  1129. } VideoOpenStruct;
  1130. #ifndef NO_IVIDEO_DECLARE
  1131. #ifdef __cplusplus
  1132. class VideoOutput;
  1133. class SubsItem;
  1134. #ifndef _NSV_DEC_IF_H_
  1135. struct YV12_PLANE {
  1136. unsigned char* baseAddr;
  1137. long rowBytes;
  1138. } ;
  1139. struct YV12_PLANES {
  1140. YV12_PLANE y;
  1141. YV12_PLANE u;
  1142. YV12_PLANE v;
  1143. };
  1144. #endif
  1145. class IVideoOutput
  1146. {
  1147. public:
  1148. virtual ~IVideoOutput() { }
  1149. virtual int open(int w, int h, int vflip, double aspectratio, unsigned int fmt)=0;
  1150. virtual void setcallback(LRESULT (*msgcallback)(void *token, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam), void *token) { (void)token; (void)msgcallback; /* to eliminate warning C4100 */ }
  1151. virtual void close()=0;
  1152. virtual void draw(void *frame)=0;
  1153. virtual void drawSubtitle(SubsItem *item) {UNREFERENCED_PARAMETER(item); }
  1154. virtual void showStatusMsg(const char *text) {UNREFERENCED_PARAMETER(text); }
  1155. virtual int get_latency() { return 0; }
  1156. virtual void notifyBufferState(int bufferstate) { UNREFERENCED_PARAMETER(bufferstate); } /* 0-255*/
  1157. virtual INT_PTR extended(INT_PTR param1, INT_PTR param2, INT_PTR param3) { UNREFERENCED_PARAMETER(param1); UNREFERENCED_PARAMETER(param2); UNREFERENCED_PARAMETER(param3); return 0; } // Dispatchable, eat this!
  1158. };
  1159. class ITrackSelector
  1160. {
  1161. public:
  1162. virtual int getNumAudioTracks()=0;
  1163. virtual void enumAudioTrackName(int n, const char *buf, int size)=0;
  1164. virtual int getCurAudioTrack()=0;
  1165. virtual int getNumVideoTracks()=0;
  1166. virtual void enumVideoTrackName(int n, const char *buf, int size)=0;
  1167. virtual int getCurVideoTrack()=0;
  1168. virtual void setAudioTrack(int n)=0;
  1169. virtual void setVideoTrack(int n)=0;
  1170. };
  1171. #endif //cplusplus
  1172. #endif//NO_IVIDEO_DECLARE
  1173. // these messages are callbacks that you can grab by subclassing the winamp window
  1174. // wParam =
  1175. #define IPC_CB_WND_EQ 0 // use one of these for the param
  1176. #define IPC_CB_WND_PE 1
  1177. #define IPC_CB_WND_MB 2
  1178. #define IPC_CB_WND_VIDEO 3
  1179. #define IPC_CB_WND_MAIN 4
  1180. #define IPC_CB_ONSHOWWND 600
  1181. #define IPC_CB_ONHIDEWND 601
  1182. #define IPC_CB_GETTOOLTIP 602
  1183. #define IPC_CB_MISC 603
  1184. #define IPC_CB_MISC_TITLE 0 // start of playing/stop/pause
  1185. #define IPC_CB_MISC_VOLUME 1 // volume/pan
  1186. #define IPC_CB_MISC_STATUS 2 // start playing/stop/pause/ffwd/rwd
  1187. #define IPC_CB_MISC_EQ 3
  1188. #define IPC_CB_MISC_INFO 4
  1189. #define IPC_CB_MISC_VIDEOINFO 5
  1190. #define IPC_CB_MISC_TITLE_RATING 6 // (5.5+ for when the rating is changed via the songticker menu on current file)
  1191. /* Example of using IPC_CB_MISC_STATUS to detect the start of track playback with 5.x
  1192. **
  1193. ** if(lParam == IPC_CB_MISC && wParam == IPC_CB_MISC_STATUS)
  1194. ** {
  1195. ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISPLAYING) == 1 &&
  1196. ** !SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTTIME))
  1197. ** {
  1198. ** char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,
  1199. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);
  1200. ** // only output if a valid file was found
  1201. ** if(file)
  1202. ** {
  1203. ** MessageBox(hwnd_winamp,file,"starting",0);
  1204. ** // or do something else that you need to do
  1205. ** }
  1206. ** }
  1207. ** }
  1208. */
  1209. #define IPC_CB_CONVERT_STATUS 604 // param value goes from 0 to 100 (percent)
  1210. #define IPC_CB_CONVERT_DONE 605
  1211. #define IPC_ADJUST_FFWINDOWSMENUPOS 606
  1212. /* (requires Winamp 2.9+)
  1213. ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFWINDOWSMENUPOS);
  1214. ** This will move where Winamp expects the freeform windows in the menubar windows main
  1215. ** menu. This is useful if you wish to insert a menu item above extra freeform windows.
  1216. */
  1217. #define IPC_ISDOUBLESIZE 608
  1218. /* (requires Winamp 5.0+)
  1219. ** int dsize=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISDOUBLESIZE);
  1220. ** You send this to Winamp to query if the double size mode is enabled or not.
  1221. ** If it is on then this will return 1 otherwise it will return 0.
  1222. */
  1223. #define IPC_ADJUST_FFOPTIONSMENUPOS 609
  1224. /* (requires Winamp 2.9+)
  1225. ** int newpos=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)adjust_offset,IPC_ADJUST_FFOPTIONSMENUPOS);
  1226. ** moves where winamp expects the freeform preferences item in the menubar windows main
  1227. ** menu. This is useful if you wish to insert a menu item above the preferences item.
  1228. **
  1229. ** Note: This setting was ignored by gen_ff until it was fixed in 5.1
  1230. ** gen_ff would assume thatthe menu position was 11 in all cases and so when you
  1231. ** had two plugins attempting to add entries into the main right click menu it
  1232. ** would cause the 'colour themes' submenu to either be incorrectly duplicated or
  1233. ** to just disappear.instead.
  1234. */
  1235. #define IPC_GETTIMEDISPLAYMODE 610
  1236. /* (requires Winamp 5.0+)
  1237. ** int mode=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETTIMEDISPLAYMODE);
  1238. ** This will return the status of the time display i.e. shows time elapsed or remaining.
  1239. ** This returns 0 if Winamp is displaying time elapsed or 1 for the time remaining.
  1240. */
  1241. #define IPC_SETVISWND 611
  1242. /* (requires Winamp 5.0+)
  1243. ** int viswnd=(HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)viswnd,IPC_SETVISWND);
  1244. ** This allows you to set a window to receive the following message commands (which are
  1245. ** used as part of the modern skin integration).
  1246. ** When you have finished or your visualisation is closed then send wParam as zero to
  1247. ** ensure that things are correctly tidied up.
  1248. */
  1249. /* The following messages are received as the LOWORD(wParam) of the WM_COMMAND message.
  1250. ** See %SDK%\winamp\wa5vis.txt for more info about visualisation integration in Winamp.
  1251. */
  1252. #define ID_VIS_NEXT 40382
  1253. #define ID_VIS_PREV 40383
  1254. #define ID_VIS_RANDOM 40384
  1255. #define ID_VIS_FS 40389
  1256. #define ID_VIS_CFG 40390
  1257. #define ID_VIS_MENU 40391
  1258. #define IPC_GETVISWND 612
  1259. /* (requires Winamp 5.0+)
  1260. ** int viswnd=(HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVISWND);
  1261. ** This returns a HWND to the visualisation command handler window if set by IPC_SETVISWND.
  1262. */
  1263. #define IPC_ISVISRUNNING 613
  1264. /* (requires Winamp 5.0+)
  1265. ** int visrunning=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_ISVISRUNNING);
  1266. ** This will return 1 if a visualisation is currently running and 0 if one is not running.
  1267. */
  1268. #define IPC_CB_VISRANDOM 628 // param is status of random
  1269. #define IPC_SETIDEALVIDEOSIZE 614
  1270. /* (requires Winamp 5.0+)
  1271. ** This is sent by Winamp back to itself so it can be trapped and adjusted as needed with
  1272. ** the desired width in HIWORD(wParam) and the desired height in LOWORD(wParam).
  1273. **
  1274. ** if(uMsg == WM_WA_IPC){
  1275. ** if(lParam == IPC_SETIDEALVIDEOSIZE){
  1276. ** wParam = MAKEWPARAM(height,width);
  1277. ** }
  1278. ** }
  1279. */
  1280. #define IPC_GETSTOPONVIDEOCLOSE 615
  1281. /* (requires Winamp 5.0+)
  1282. ** int sovc=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETSTOPONVIDEOCLOSE);
  1283. ** This will return 1 if 'stop on video close' is enabled and 0 if it is disabled.
  1284. */
  1285. #define IPC_SETSTOPONVIDEOCLOSE 616
  1286. /* (requires Winamp 5.0+)
  1287. ** int sovc=SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETSTOPONVIDEOCLOSE);
  1288. ** Set enabled to 1 to enable and 0 to disable the 'stop on video close' option.
  1289. */
  1290. typedef struct {
  1291. HWND hwnd;
  1292. int uMsg;
  1293. WPARAM wParam;
  1294. LPARAM lParam;
  1295. } transAccelStruct;
  1296. #define IPC_TRANSLATEACCELERATOR 617
  1297. /* (requires Winamp 5.0+)
  1298. ** (deprecated as of 5.53x+)
  1299. */
  1300. typedef struct {
  1301. int cmd;
  1302. int x;
  1303. int y;
  1304. int align;
  1305. } windowCommand; // send this as param to an IPC_PLCMD, IPC_MBCMD, IPC_VIDCMD
  1306. #define IPC_CB_ONTOGGLEAOT 618
  1307. #define IPC_GETPREFSWND 619
  1308. /* (requires Winamp 5.0+)
  1309. ** HWND prefs = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND);
  1310. ** This will return a handle to the preferences dialog if it is open otherwise it will
  1311. ** return zero. A simple check with the OS api IsWindow(..) is a good test if it's valid.
  1312. **
  1313. ** e.g. this will open (or close if already open) the preferences dialog and show if we
  1314. ** managed to get a valid
  1315. ** SendMessage(hwnd_winamp,WM_COMMAND,MAKEWPARAM(WINAMP_OPTIONS_PREFS,0),0);
  1316. ** MessageBox(hwnd_winamp,(IsWindow((HWND)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETPREFSWND))?"Valid":"Not Open"),0,MB_OK);
  1317. */
  1318. #define IPC_SET_PE_WIDTHHEIGHT 620
  1319. /* (requires Winamp 5.0+)
  1320. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&point,IPC_SET_PE_WIDTHHEIGHT);
  1321. ** You pass a pointer to a POINT structure which holds the width and height and Winamp
  1322. ** will set the playlist editor to that size (this is used by gen_ff on skin changes).
  1323. ** There does not appear to be any bounds limiting with this so it is possible to create
  1324. ** a zero size playlist editor window (which is a pretty silly thing to do).
  1325. */
  1326. #define IPC_GETLANGUAGEPACKINSTANCE 621
  1327. /* (requires Winamp 5.0+)
  1328. ** HINSTANCE hInst = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1329. ** This will return the HINSTANCE to the currently used language pack file for winamp.exe
  1330. **
  1331. ** (5.5+)
  1332. ** If you pass 1 in wParam then you will have zero returned if a language pack is in use.
  1333. ** if(!SendMessage(hwnd_winamp,WM_WA_IPC,1,IPC_GETLANGUAGEPACKINSTANCE)){
  1334. ** // winamp is currently using a language pack
  1335. ** }
  1336. **
  1337. ** If you pass 2 in wParam then you will get the path to the language pack folder.
  1338. ** wchar_t* lngpackfolder = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,2,IPC_GETLANGUAGEPACKINSTANCE);
  1339. **
  1340. ** If you pass 3 in wParam then you will get the path to the currently extracted language pack.
  1341. ** wchar_t* lngpack = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,3,IPC_GETLANGUAGEPACKINSTANCE);
  1342. **
  1343. ** If you pass 4 in wParam then you will get the name of the currently used language pack.
  1344. ** wchar_t* lngname = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,4,IPC_GETLANGUAGEPACKINSTANCE);
  1345. */
  1346. #define LANG_IDENT_STR 0
  1347. #define LANG_LANG_CODE 1
  1348. #define LANG_COUNTRY_CODE 2
  1349. /*
  1350. ** (5.51+)
  1351. ** If you pass 5 in LOWORD(wParam) then you will get the ident string/code string
  1352. ** (based on the param passed in the HIWORD(wParam) of the currently used language pack.
  1353. ** The string returned with LANG_IDENT_STR is used to represent the language that the
  1354. ** language pack is intended for following ISO naming conventions for consistancy.
  1355. **
  1356. ** wchar_t* ident_str = (wchar_t*)SendMessage(hwnd_winamp,WM_WA_IPC,MAKEWPARAM(5,LANG_XXX),IPC_GETLANGUAGEPACKINSTANCE);
  1357. **
  1358. ** e.g.
  1359. ** For the default language it will return the following for the different LANG_XXX codes
  1360. ** LANG_IDENT_STR -> "en-US" (max buffer size of this is 9 wchar_t)
  1361. ** LANG_LANG_CODE -> "en" (language code)
  1362. ** LANG_COUNTRY_CODE -> "US" (country code)
  1363. **
  1364. ** On pre 5.51 installs you can get LANG_IDENT_STR using the following method
  1365. ** (you'll have to custom process the string returned if you want the langugage or country but that's easy ;) )
  1366. **
  1367. ** #define LANG_PACK_LANG_ID 65534 (if you don't have lang.h)
  1368. ** HINSTANCE hInst = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1369. ** TCHAR buffer[9] = {0};
  1370. ** LoadString(hInst,LANG_PACK_LANG_ID,buffer,sizeof(buffer));
  1371. **
  1372. **
  1373. **
  1374. ** The following example shows how using the basic api will allow you to load the playlist
  1375. ** context menu resource from the currently loaded language pack or it will fallback to
  1376. ** the default winamp.exe instance.
  1377. **
  1378. ** HINSTANCE lang = (HINSTANCE)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLANGUAGEPACKINSTANCE);
  1379. ** HMENU popup = GetSubMenu(GetSubMenu((LoadMenu(lang?lang:GetModuleHandle(0),MAKEINTRESOURCE(101))),2),5);
  1380. ** // do processing as needed on the menu before displaying it
  1381. ** TrackPopupMenuEx(orig,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,rc.left,rc.bottom,hwnd_owner,0);
  1382. ** DestroyMenu(popup);
  1383. **
  1384. ** If you need a specific menu handle then look at IPC_GET_HMENU for more information.
  1385. */
  1386. #define IPC_CB_PEINFOTEXT 622 // data is a string, ie: "04:21/45:02"
  1387. #define IPC_CB_OUTPUTCHANGED 623 // output plugin was changed in config
  1388. #define IPC_GETOUTPUTPLUGIN 625
  1389. /* (requires Winamp 5.0+)
  1390. ** char* outdll = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETOUTPUTPLUGIN);
  1391. ** This returns a string of the current output plugin's dll name.
  1392. ** e.g. if the directsound plugin was selected then this would return 'out_ds.dll'.
  1393. */
  1394. #define IPC_SETDRAWBORDERS 626
  1395. /* (requires Winamp 5.0+)
  1396. ** SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_SETDRAWBORDERS);
  1397. ** Set enabled to 1 to enable and 0 to disable drawing of the playlist editor and winamp
  1398. ** gen class windows (used by gen_ff to allow it to draw its own window borders).
  1399. */
  1400. #define IPC_DISABLESKINCURSORS 627
  1401. /* (requires Winamp 5.0+)
  1402. ** SendMessage(hwnd_winamp,WM_WA_IPC,enabled,IPC_DISABLESKINCURSORS);
  1403. ** Set enabled to 1 to enable and 0 to disable the use of skinned cursors.
  1404. */
  1405. #define IPC_GETSKINCURSORS 628
  1406. /* (requires Winamp 5.36+)
  1407. ** data = (WACURSOR)cursorId. (check wa_dlg.h for values)
  1408. */
  1409. #define IPC_CB_RESETFONT 629
  1410. #define IPC_IS_FULLSCREEN 630
  1411. /* (requires Winamp 5.0+)
  1412. ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_FULLSCREEN);
  1413. ** This will return 1 if the video or visualisation is in fullscreen mode or 0 otherwise.
  1414. */
  1415. #define IPC_SET_VIS_FS_FLAG 631
  1416. /* (requires Winamp 5.0+)
  1417. ** A vis should send this message with 1/as param to notify winamp that it has gone to or has come back from fullscreen mode
  1418. */
  1419. #define IPC_SHOW_NOTIFICATION 632
  1420. #define IPC_GETSKININFO 633
  1421. #define IPC_GETSKININFOW 1633
  1422. /* (requires Winamp 5.0+)
  1423. ** This is a notification message sent to the main Winamp window by itself whenever it
  1424. ** needs to get information to be shown about the current skin in the 'Current skin
  1425. ** information' box on the main Skins page in the Winamp preferences.
  1426. **
  1427. ** When this notification is received and the current skin is one you are providing the
  1428. ** support for then you return a valid buffer for Winamp to be able to read from with
  1429. ** information about it such as the name of the skin file.
  1430. **
  1431. ** if(uMsg == WM_WA_IPC && lParam == IPC_GETSKININFO){
  1432. ** if(is_our_skin()){
  1433. ** return is_our_skin_name();
  1434. ** }
  1435. ** }
  1436. */
  1437. #define IPC_GET_MANUALPLADVANCE 634
  1438. /* (requires Winamp 5.03+)
  1439. ** int val=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_MANUALPLADVANCE);
  1440. ** IPC_GET_MANUALPLADVANCE returns the status of the Manual Playlist Advance.
  1441. ** If enabled this will return 1 otherwise it will return 0.
  1442. */
  1443. #define IPC_SET_MANUALPLADVANCE 635
  1444. /* (requires Winamp 5.03+)
  1445. ** SendMessage(hwnd_winamp,WM_WA_IPC,value,IPC_SET_MANUALPLADVANCE);
  1446. ** IPC_SET_MANUALPLADVANCE sets the status of the Manual Playlist Advance option.
  1447. ** Set value = 1 to turn it on and value = 0 to turn it off.
  1448. */
  1449. #define IPC_GET_NEXT_PLITEM 636
  1450. /* (requires Winamp 5.04+)
  1451. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_EOF_GET_NEXT_PLITEM);
  1452. **
  1453. ** Sent to Winamp's main window when an item has just finished playback or the next
  1454. ** button has been pressed and requesting the new playlist item number to go to.
  1455. **
  1456. ** Subclass this message in your application to return the new item number.
  1457. ** Return -1 for normal Winamp operation (default) or the new item number in
  1458. ** the playlist to be played instead of the originally selected next track.
  1459. */
  1460. #define IPC_GET_PREVIOUS_PLITEM 637
  1461. /* (requires Winamp 5.04+)
  1462. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_EOF_GET_PREVIOUS_PLITEM);
  1463. **
  1464. ** Sent to Winamp's main window when the previous button has been pressed and Winamp is
  1465. ** requesting the new playlist item number to go to.
  1466. **
  1467. ** Return -1 for normal Winamp operation (default) or the new item number in
  1468. ** the playlist to be played instead of the originally selected previous track.
  1469. **
  1470. ** This is primarily provided for the JTFE plugin (gen_jumpex.dll).
  1471. */
  1472. #define IPC_IS_WNDSHADE 638
  1473. /* (requires Winamp 5.04+)
  1474. ** int is_shaded=SendMessage(hwnd_winamp,WM_WA_IPC,wnd,IPC_IS_WNDSHADE);
  1475. ** Pass 'wnd' as an id as defined for IPC_GETWND or pass -1 to query the status of the
  1476. ** main window. This returns 1 if the window is in winshade mode and 0 if it is not.
  1477. ** Make sure you only test for this on a 5.04+ install otherwise you get a false result.
  1478. ** (See the notes about unhandled WM_WA_IPC messages).
  1479. */
  1480. #define IPC_SETRATING 639
  1481. /* (requires Winamp 5.04+ with ML)
  1482. ** int rating=SendMessage(hwnd_winamp,WM_WA_IPC,rating,IPC_SETRATING);
  1483. ** This will allow you to set the 'rating' on the current playlist entry where 'rating'
  1484. ** is an integer value from 0 (no rating) to 5 (5 stars).
  1485. **
  1486. ** The following example should correctly allow you to set the rating for any specified
  1487. ** playlist entry assuming of course that you're trying to get a valid playlist entry.
  1488. **
  1489. ** void SetPlaylistItemRating(int item_to_set, int rating_to_set){
  1490. ** int cur_pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS);
  1491. ** SendMessage(hwnd_winamp,WM_WA_IPC,item_to_set,IPC_SETPLAYLISTPOS);
  1492. ** SendMessage(hwnd_winamp,WM_WA_IPC,rating_to_set,IPC_SETRATING);
  1493. ** SendMessage(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
  1494. ** }
  1495. */
  1496. #define IPC_GETRATING 640
  1497. /* (requires Winamp 5.04+ with ML)
  1498. ** int rating=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
  1499. ** This returns the current playlist entry's rating between 0 (no rating) to 5 (5 stars).
  1500. **
  1501. ** The following example should correctly allow you to get the rating for any specified
  1502. ** playlist entry assuming of course that you're trying to get a valid playlist entry.
  1503. **
  1504. ** int GetPlaylistItemRating(int item_to_get, int rating_to_set){
  1505. ** int cur_pos=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS), rating = 0;
  1506. ** SendMessage(hwnd_winamp,WM_WA_IPC,item_to_get,IPC_SETPLAYLISTPOS);
  1507. ** rating = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETRATING);
  1508. ** SendMessage(hwnd_winamp,WM_WA_IPC,cur_pos,IPC_SETPLAYLISTPOS);
  1509. ** return rating;
  1510. ** }
  1511. */
  1512. #define IPC_GETNUMAUDIOTRACKS 641
  1513. /* (requires Winamp 5.04+)
  1514. ** int n = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMAUDIOTRACKS);
  1515. ** This will return the number of audio tracks available from the currently playing item.
  1516. */
  1517. #define IPC_GETNUMVIDEOTRACKS 642
  1518. /* (requires Winamp 5.04+)
  1519. ** int n = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETNUMVIDEOTRACKS);
  1520. ** This will return the number of video tracks available from the currently playing item.
  1521. */
  1522. #define IPC_GETAUDIOTRACK 643
  1523. /* (requires Winamp 5.04+)
  1524. ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETAUDIOTRACK);
  1525. ** This will return the id of the current audio track for the currently playing item.
  1526. */
  1527. #define IPC_GETVIDEOTRACK 644
  1528. /* (requires Winamp 5.04+)
  1529. ** int cur = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVIDEOTRACK);
  1530. ** This will return the id of the current video track for the currently playing item.
  1531. */
  1532. #define IPC_SETAUDIOTRACK 645
  1533. /* (requires Winamp 5.04+)
  1534. ** SendMessage(hwnd_winamp,WM_WA_IPC,track,IPC_SETAUDIOTRACK);
  1535. ** This allows you to switch to a new audio track (if supported) in the current playing file.
  1536. */
  1537. #define IPC_SETVIDEOTRACK 646
  1538. /* (requires Winamp 5.04+)
  1539. ** SendMessage(hwnd_winamp,WM_WA_IPC,track,IPC_SETVIDEOTRACK);
  1540. ** This allows you to switch to a new video track (if supported) in the current playing file.
  1541. */
  1542. #define IPC_PUSH_DISABLE_EXIT 647
  1543. /* (requires Winamp 5.04+)
  1544. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_PUSH_DISABLE_EXIT);
  1545. ** This will let you disable or re-enable the UI exit functions (close button, context
  1546. ** menu, alt-f4). Remember to call IPC_POP_DISABLE_EXIT when you are done doing whatever
  1547. ** was required that needed to prevent exit otherwise you have to kill the Winamp process.
  1548. */
  1549. #define IPC_POP_DISABLE_EXIT 648
  1550. /* (requires Winamp 5.04+)
  1551. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_POP_DISABLE_EXIT);
  1552. ** See IPC_PUSH_DISABLE_EXIT
  1553. */
  1554. #define IPC_IS_EXIT_ENABLED 649
  1555. /* (requires Winamp 5.04+)
  1556. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_EXIT_ENABLED);
  1557. ** This will return 0 if the 'exit' option of Winamp's menu is disabled and 1 otherwise.
  1558. */
  1559. #define IPC_IS_AOT 650
  1560. /* (requires Winamp 5.04+)
  1561. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_IS_AOT);
  1562. ** This will return the status of the always on top flag.
  1563. ** Note: This may not match the actual TOPMOST window flag while another fullscreen
  1564. ** application is focused if the user has the 'Disable always on top while fullscreen
  1565. ** applications are focused' option under the General Preferences page is checked.
  1566. */
  1567. #define IPC_USES_RECYCLEBIN 651
  1568. /* (requires Winamp 5.09+)
  1569. ** int use_bin=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN);
  1570. ** This will return 1 if the deleted file should be sent to the recycle bin or
  1571. ** 0 if deleted files should be deleted permanently (default action for < 5.09).
  1572. **
  1573. ** Note: if you use this on pre 5.09 installs of Winamp then it will return 1 which is
  1574. ** not correct but is due to the way that SendMessage(..) handles un-processed messages.
  1575. ** Below is a quick case for checking if the returned value is correct.
  1576. **
  1577. ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USES_RECYCLEBIN) &&
  1578. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETVERSION)>=0x5009)
  1579. ** {
  1580. ** // can safely follow the option to recycle the file
  1581. ** }
  1582. ** else
  1583. * {
  1584. ** // need to do a permanent delete of the file
  1585. ** }
  1586. */
  1587. #define IPC_FLUSHAUDITS 652
  1588. /*
  1589. ** SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_FLUSHAUDITS);
  1590. **
  1591. ** Will flush any pending audits in the global audits queue
  1592. **
  1593. */
  1594. #define IPC_GETPLAYITEM_START 653
  1595. #define IPC_GETPLAYITEM_END 654
  1596. #define IPC_GETVIDEORESIZE 655
  1597. #define IPC_SETVIDEORESIZE 656
  1598. #define IPC_INITIAL_SHOW_STATE 657
  1599. /* (requires Winamp 5.36+)
  1600. ** int show_state = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE);
  1601. ** returns the processed value of nCmdShow when Winamp was started
  1602. ** (see MSDN documentation the values passed to WinMain(..) for what this should be)
  1603. **
  1604. ** e.g.
  1605. ** if(SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_INITIAL_SHOW_STATE) == SW_SHOWMINIMIZED){
  1606. ** // we are starting minimised so process as needed (keep our window hidden)
  1607. ** }
  1608. **
  1609. ** Useful for seeing if winamp was run minimised on startup so you can act accordingly.
  1610. ** On pre-5.36 versions this will effectively return SW_NORMAL/SW_SHOWNORMAL due to the
  1611. ** handling of unknown apis returning 1 from Winamp.
  1612. */
  1613. // >>>>>>>>>>> Next is 658
  1614. #define IPC_PLCMD 1000
  1615. #define PLCMD_ADD 0
  1616. #define PLCMD_REM 1
  1617. #define PLCMD_SEL 2
  1618. #define PLCMD_MISC 3
  1619. #define PLCMD_LIST 4
  1620. //#define IPC_MBCMD 1001
  1621. #define MBCMD_BACK 0
  1622. #define MBCMD_FORWARD 1
  1623. #define MBCMD_STOP 2
  1624. #define MBCMD_RELOAD 3
  1625. #define MBCMD_MISC 4
  1626. #define IPC_VIDCMD 1002
  1627. #define VIDCMD_FULLSCREEN 0
  1628. #define VIDCMD_1X 1
  1629. #define VIDCMD_2X 2
  1630. #define VIDCMD_LIB 3
  1631. #define VIDPOPUP_MISC 4
  1632. //#define IPC_MBURL 1003 //sets the URL
  1633. //#define IPC_MBGETCURURL 1004 //copies the current URL into wParam (have a 4096 buffer ready)
  1634. //#define IPC_MBGETDESC 1005 //copies the current URL description into wParam (have a 4096 buffer ready)
  1635. //#define IPC_MBCHECKLOCFILE 1006 //checks that the link file is up to date (otherwise updates it). wParam=parent HWND
  1636. //#define IPC_MBREFRESH 1007 //refreshes the "now playing" view in the library
  1637. //#define IPC_MBGETDEFURL 1008 //copies the default URL into wParam (have a 4096 buffer ready)
  1638. #define IPC_STATS_LIBRARY_ITEMCNT 1300 // updates library count status
  1639. /*
  1640. ** IPC's in the message range 2000 - 3000 are reserved internally for freeform messages.
  1641. ** These messages are taken from ff_ipc.h which is part of the Modern skin integration.
  1642. */
  1643. #define IPC_FF_FIRST 2000
  1644. #define IPC_FF_COLOURTHEME_CHANGE IPC_FF_ONCOLORTHEMECHANGED
  1645. #define IPC_FF_ONCOLORTHEMECHANGED IPC_FF_FIRST + 3
  1646. /*
  1647. ** This is a notification message sent when the user changes the colour theme in a Modern
  1648. ** skin and can also be detected when the Modern skin is first loaded as the gen_ff plugin
  1649. ** applies relevant settings and styles (like the colour theme).
  1650. **
  1651. ** The value of wParam is the name of the new color theme being switched to.
  1652. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)colour_theme_name,IPC_FF_ONCOLORTHEMECHANGED);
  1653. **
  1654. ** (IPC_FF_COLOURTHEME_CHANGE is the name i (DrO) was using before getting a copy of
  1655. ** ff_ipc.h with the proper name in it).
  1656. */
  1657. #define IPC_FF_ISMAINWND IPC_FF_FIRST + 4
  1658. /*
  1659. ** int ismainwnd = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_ISMAINWND);
  1660. **
  1661. ** This allows you to determine if the window handle passed to it is a modern skin main
  1662. ** window or not. If it is a main window or any of its windowshade variants then it will
  1663. ** return 1.
  1664. **
  1665. ** Because of the way modern skins are implemented, it is possible for this message to
  1666. ** return a positive test result for a number of window handles within the current Winamp
  1667. ** process. This appears to be because you can have a visible main window, a compact main
  1668. ** window and also a winshaded version.
  1669. **
  1670. ** The following code example below is one way of seeing how this api works since it will
  1671. ** enumerate all windows related to Winamp at the time and allows you to process as
  1672. ** required when a detection happens.
  1673. **
  1674. **
  1675. ** EnumThreadWindows(GetCurrentThreadId(),enumWndProc,0);
  1676. **
  1677. ** BOOL CALLBACK enumWndProc(HWND hwnd, LPARAM lParam){
  1678. **
  1679. ** if(SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)hwnd,IPC_FF_ISMAINWND)){
  1680. ** // do processing in here
  1681. ** // or continue the enum for other main windows (if they exist)
  1682. ** // and just comment out the line below
  1683. ** return 0;
  1684. ** }
  1685. ** return 1;
  1686. ** }
  1687. */
  1688. #define IPC_FF_GETCONTENTWND IPC_FF_FIRST + 5
  1689. /*
  1690. ** HWND wa2embed = (HWND)SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(HWND)test_wnd,IPC_FF_GETCONTENTWND);
  1691. **
  1692. ** This will return the Winamp 2 window that is embedded in the window's container
  1693. ** i.e. if hwnd is the playlist editor windowshade hwnd then it will return the Winamp 2
  1694. ** playlist editor hwnd.
  1695. **
  1696. ** If no content is found such as the window has nothing embedded then this will return
  1697. ** the hwnd passed to it.
  1698. */
  1699. #define IPC_FF_NOTIFYHOTKEY IPC_FF_FIRST + 6
  1700. /*
  1701. ** This is a notification message sent when the user uses a global hotkey combination
  1702. ** which had been registered with the gen_hotkeys plugin.
  1703. **
  1704. ** The value of wParam is the description of the hotkey as passed to gen_hotkeys.
  1705. ** SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(const char*)hotkey_desc,IPC_FF_NOTIFYHOTKEY);
  1706. */
  1707. #define IPC_FF_LAST 3000
  1708. /*
  1709. ** General IPC messages in Winamp
  1710. **
  1711. ** All notification messages appear in the lParam of the main window message proceedure.
  1712. */
  1713. #define IPC_GETDROPTARGET 3001
  1714. /* (requires Winamp 5.0+)
  1715. ** IDropTarget* IDrop = (IDropTarget*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETDROPTARGET);
  1716. **
  1717. ** You call this to retrieve a copy of the IDropTarget interface which Winamp created for
  1718. ** handling external drag and drop operations on to it's Windows. This is only really
  1719. ** useful if you're providing an alternate interface and want your Windows to provide the
  1720. ** same drag and drop support as Winamp normally provides the user. Check out MSDN or
  1721. ** your prefered search facility for more information about the IDropTarget interface and
  1722. ** what's needed to handle it in your own instance.
  1723. */
  1724. #define IPC_PLAYLIST_MODIFIED 3002
  1725. /* (requires Winamp 5.0+)
  1726. ** This is a notification message sent to the main Winamp window whenever the playlist is
  1727. ** modified in any way e.g. the addition/removal of a playlist entry.
  1728. **
  1729. ** It is not a good idea to do large amounts of processing in this notification since it
  1730. ** will slow down Winamp as playlist entries are modified (especially when you're adding
  1731. ** in a large playlist).
  1732. **
  1733. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYLIST_MODIFIED)
  1734. ** {
  1735. ** // do what you need to do here
  1736. ** }
  1737. */
  1738. #define IPC_PLAYING_FILE 3003
  1739. /* (requires Winamp 5.0+)
  1740. ** This is a notification message sent to the main Winamp window when playback begins for
  1741. ** a file. This passes the full filepath in the wParam of the message received.
  1742. **
  1743. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILE)
  1744. ** {
  1745. ** // do what you need to do here, e.g.
  1746. ** process_file((char*)wParam);
  1747. ** }
  1748. */
  1749. #define IPC_PLAYING_FILEW 13003
  1750. /* (requires Winamp 5.0+)
  1751. ** This is a notification message sent to the main Winamp window when playback begins for
  1752. ** a file. This passes the full filepath in the wParam of the message received.
  1753. **
  1754. ** if(uMsg == WM_WA_IPC && lParam == IPC_PLAYING_FILEW)
  1755. ** {
  1756. ** // do what you need to do here, e.g.
  1757. ** process_file((wchar_t*)wParam);
  1758. ** }
  1759. */
  1760. #define IPC_FILE_TAG_MAY_HAVE_UPDATED 3004
  1761. #define IPC_FILE_TAG_MAY_HAVE_UPDATEDW 3005
  1762. /* (requires Winamp 5.0+)
  1763. ** This is a notification message sent to the main Winamp window when a file's tag
  1764. ** (e.g. id3) may have been updated. This appears to be sent when the InfoBox(..) function
  1765. ** of the associated input plugin returns a 1 (which is the file information dialog/editor
  1766. ** call normally).
  1767. **
  1768. ** if(uMsg == WM_WA_IPC && lParam == IPC_FILE_TAG_MAY_HAVE_UPDATED)
  1769. ** {
  1770. ** // do what you need to do here, e.g.
  1771. ** update_info_on_file_update((char*)wParam);
  1772. ** }
  1773. */
  1774. #define IPC_ALLOW_PLAYTRACKING 3007
  1775. /* (requires Winamp 5.0+)
  1776. ** SendMessage(hwnd_winamp,WM_WA_IPC,allow,IPC_ALLOW_PLAYTRACKING);
  1777. ** Send allow as nonzero to allow play tracking and zero to disable the mode.
  1778. */
  1779. #define IPC_HOOK_OKTOQUIT 3010
  1780. /* (requires Winamp 5.0+)
  1781. ** This is a notification message sent to the main Winamp window asking if it's okay to
  1782. ** close or not. Return zero to prevent Winamp from closing or return anything non-zero
  1783. ** to allow Winamp to close.
  1784. **
  1785. ** The best implementation of this option is to let the message pass through to the
  1786. ** original window proceedure since another plugin may want to have a say in the matter
  1787. ** with regards to Winamp closing.
  1788. **
  1789. ** if(uMsg == WM_WA_IPC && lParam == IPC_HOOK_OKTOQUIT)
  1790. ** {
  1791. ** // do what you need to do here, e.g.
  1792. ** if(no_shut_down())
  1793. ** {
  1794. ** return 1;
  1795. ** }
  1796. ** }
  1797. */
  1798. #define IPC_WRITECONFIG 3011
  1799. /* (requires Winamp 5.0+)
  1800. ** SendMessage(hwnd_winamp,WM_WA_IPC,write_type,IPC_WRITECONFIG);
  1801. **
  1802. ** Send write_type as 2 to write all config settings and the current playlist.
  1803. **
  1804. ** Send write_type as 1 to write the playlist and common settings.
  1805. ** This won't save the following ini settings::
  1806. **
  1807. ** defext, titlefmt, proxy, visplugin_name, dspplugin_name, check_ft_startup,
  1808. ** visplugin_num, pe_fontsize, visplugin_priority, visplugin_autoexec, dspplugin_num,
  1809. ** sticon, splash, taskbar, dropaotfs, ascb_new, ttips, riol, minst, whichicon,
  1810. ** whichicon2, addtolist, snap, snaplen, parent, hilite, disvis, rofiob, shownumsinpl,
  1811. ** keeponscreen, eqdsize, usecursors, fixtitles, priority, shuffle_morph_rate,
  1812. ** useexttitles, bifont, inet_mode, ospb, embedwnd_freesize, no_visseh
  1813. ** (the above was valid for 5.1)
  1814. **
  1815. ** Send write_type as 0 to write the common and less common settings and no playlist.
  1816. */
  1817. #define IPC_UPDATE_URL 3012
  1818. // pass the URL (char *) in lparam, will be free()'d on done.
  1819. #define IPC_GET_RANDFUNC 3015 // returns a function to get a random number
  1820. /* (requires Winamp 5.1+)
  1821. ** int (*randfunc)(void) = (int(*)(void))SendMessage(plugin.hwndParent,WM_WA_IPC,0,IPC_GET_RANDFUNC);
  1822. ** if(randfunc && randfunc != 1){
  1823. ** randfunc();
  1824. ** }
  1825. **
  1826. ** This will return a positive 32-bit number (essentially 31-bit).
  1827. ** The check for a returned value of 1 is because that's the default return value from
  1828. ** SendMessage(..) when it is not handled so is good to check for it in this situation.
  1829. */
  1830. #define IPC_METADATA_CHANGED 3017
  1831. /* (requires Winamp 5.1+)
  1832. ** int changed=SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)(char*)field,IPC_METADATA_CHANGED);
  1833. ** a plugin can SendMessage this to winamp if internal metadata has changes.
  1834. ** wParam should be a char * of what field changed
  1835. **
  1836. ** Currently used for internal actions (and very few at that) the intent of this api is
  1837. ** to allow a plugin to call it when metadata has changed in the current playlist entry
  1838. ** e.g.a new id3v2 tag was found in a stream
  1839. **
  1840. ** The wparam value can either be NULL or a pointer to an ansi string for the metadata
  1841. ** which has changed. This can be thought of as an advanced version of IPC_UPDTITLE and
  1842. ** could be used to allow for update of the current title when a specific tag changed.
  1843. **
  1844. ** Not recommended to be used since there is not the complete handling implemented in
  1845. ** Winamp for it at the moment.
  1846. */
  1847. #define IPC_SKIN_CHANGED 3018
  1848. /* (requires Winamp 5.1+)
  1849. ** This is a notification message sent to the main Winamp window by itself whenever
  1850. ** the skin in use is changed. There is no information sent by the wParam for this.
  1851. **
  1852. ** if(message == WM_WA_IPC && lparam == IPC_SKIN_CHANGED)
  1853. ** {
  1854. ** // do what you need to do to handle skin changes, e.g. call WADlg_init(hwnd_winamp);
  1855. ** }
  1856. */
  1857. #define IPC_REGISTER_LOWORD_COMMAND 3019
  1858. /* (requires Winamp 5.1+)
  1859. ** WORD id = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_REGISTER_LOWORD_COMMAND);
  1860. ** This will assign you a unique id for making your own commands such as for extra menu
  1861. ** entries. The starting value returned by this message will potentially change as and
  1862. ** when the main resource file of Winamp is updated with extra data so assumptions cannot
  1863. ** be made on what will be returned and plugin loading order will affect things as well.
  1864. ** 5.33+
  1865. ** If you want to reserve more than one id, you can pass the number of ids required in wParam
  1866. */
  1867. #define IPC_GET_DISPATCH_OBJECT 3020 // gets winamp main IDispatch * (for embedded webpages)
  1868. #define IPC_GET_UNIQUE_DISPATCH_ID 3021 // gives you a unique dispatch ID that won't conflict with anything in winamp's IDispatch *
  1869. #define IPC_ADD_DISPATCH_OBJECT 3022 // add your own dispatch object into winamp's. This lets embedded webpages access your functions
  1870. // pass a pointer to DispatchInfo (see below). Winamp makes a copy of all this data so you can safely delete it later
  1871. typedef struct
  1872. {
  1873. wchar_t *name; // filled in by plugin, make sure it's a unicode string!! (i.e. L"myObject" instead of "myObject).
  1874. struct IDispatch *dispatch; // filled in by plugin
  1875. DWORD id; // filled in by winamp on return
  1876. } DispatchInfo;
  1877. // see IPC_JSAPI2_GET_DISPATCH_OBJECT for version 2 of the Dispatchable scripting interface
  1878. #define IPC_GET_PROXY_STRING 3023
  1879. /* (requires Winamp 5.11+)
  1880. ** char* proxy_string=(char*)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_PROXY_STRING);
  1881. ** This will return the same string as is shown on the General Preferences page.
  1882. */
  1883. #define IPC_USE_REGISTRY 3024
  1884. /* (requires Winamp 5.11+)
  1885. ** int reg_enabled=SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_USE_REGISTRY);
  1886. ** This will return 0 if you should leave your grubby hands off the registry (i.e. for
  1887. ** lockdown mode). This is useful if Winamp is run from a USB drive and you can't alter
  1888. ** system settings, etc.
  1889. */
  1890. #define IPC_GET_API_SERVICE 3025
  1891. /* (requires Winamp 5.12+)
  1892. ** api_service* api_service = (api_service)SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_API_SERVICE);
  1893. ** This api will return Winamp's api_service pointer (which is what Winamp3 used, heh).
  1894. ** If this api is not supported in the Winamp version that is being used at the time then
  1895. ** the returned value from this api will be 1 which is a good version check.
  1896. **
  1897. ** As of 5.12 there is support for .w5s plugins which reside in %WinampDir%\System and
  1898. ** are intended for common code that can be shared amongst other plugins e.g. jnetlib.w5s
  1899. ** which contains jnetlib in one instance instead of being duplicated multiple times in
  1900. ** all of the plugins which need internet access.
  1901. **
  1902. ** Details on the .w5s specifications will come at some stage (possibly).
  1903. */
  1904. typedef struct {
  1905. const wchar_t *filename;
  1906. const wchar_t *metadata;
  1907. wchar_t *ret;
  1908. size_t retlen;
  1909. } extendedFileInfoStructW;
  1910. #define IPC_GET_EXTENDED_FILE_INFOW 3026
  1911. /* (requires Winamp 5.13+)
  1912. ** Pass a pointer to the above struct in wParam
  1913. */
  1914. #define IPC_GET_EXTENDED_FILE_INFOW_HOOKABLE 3027
  1915. #define IPC_SET_EXTENDED_FILE_INFOW 3028
  1916. /* (requires Winamp 5.13+)
  1917. ** Pass a pointer to the above struct in wParam
  1918. */
  1919. #define IPC_PLAYLIST_GET_NEXT_SELECTED 3029
  1920. /* (requires 5.2+)
  1921. ** int pl_item = SendMessage(hwnd_winamp,WM_WA_IPC,start,IPC_PLAYLIST_GET_NEXT_SELECTED);
  1922. **
  1923. ** This works just like the ListView_GetNextItem(..) macro for ListView controls.
  1924. ** 'start' is the index of the playlist item that you want to begin the search after or
  1925. ** set this as -1 for the search to begin with the first item of the current playlist.
  1926. **
  1927. ** This will return the index of the selected playlist according to the 'start' value or
  1928. ** it returns -1 if there is no selection or no more selected items according to 'start'.
  1929. **
  1930. ** Quick example:
  1931. **
  1932. ** int sel = -1;
  1933. ** // keep incrementing the start of the search so we get all of the selected entries
  1934. ** while((sel = SendMessage(hwnd_winamp,WM_WA_IPC,sel,IPC_PLAYLIST_GET_NEXT_SELECTED))!=-1){
  1935. ** // show the playlist file entry of the selected item(s) if there were any
  1936. ** MessageBox(hwnd_winamp,(char*)SendMessage(hwnd_winamp,WM_WA_IPC,sel,IPC_GETPLAYLISTFILE),0,0);
  1937. ** }
  1938. */
  1939. #define IPC_PLAYLIST_GET_SELECTED_COUNT 3030
  1940. /* (requires 5.2+)
  1941. ** int selcnt = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_PLAYLIST_GET_SELECTED_COUNT);
  1942. ** This will return the number of selected playlist entries.
  1943. */
  1944. #define IPC_GET_PLAYING_FILENAME 3031
  1945. // returns wchar_t * of the currently playing filename
  1946. #define IPC_OPEN_URL 3032
  1947. // send either ANSI or Unicode string (it'll figure it out, but it MUST start with "h"!, so don't send ftp:// or anything funny)
  1948. // you can also send this one from another process via WM_COPYDATA (unicode only)
  1949. #define IPC_USE_UXTHEME_FUNC 3033
  1950. /* (requires Winamp 5.35+)
  1951. ** int ret = SendMessage(hwnd_winamp,WM_WA_IPC,param,IPC_USE_UXTHEME_FUNC);
  1952. ** param can be IPC_ISWINTHEMEPRESENT or IPC_ISAEROCOMPOSITIONACTIVE or a valid hwnd.
  1953. **
  1954. ** If you pass a hwnd then it will apply EnableThemeDialogTexture(ETDT_ENABLETAB)
  1955. ** so your tabbed dialogs can use the correct theme (on supporting OSes ie XP+).
  1956. **
  1957. ** Otherwise this will return a value based on the param passed (as defined below).
  1958. ** For compatability, the return value will be zero on success (as 1 is returned
  1959. ** for unsupported ipc calls on older Winamp versions)
  1960. */
  1961. #define IPC_ISWINTHEMEPRESENT 0
  1962. /* This will return 0 if uxtheme.dll is present
  1963. ** int isthemethere = !SendMessage(hwnd_winamp,WM_WA_IPC,IPC_ISWINTHEMEPRESENT,IPC_USE_UXTHEME_FUNC);
  1964. */
  1965. #define IPC_ISAEROCOMPOSITIONACTIVE 1
  1966. /* This will return 0 if aero composition is active
  1967. ** int isaero = !SendMessage(hwnd_winamp,WM_WA_IPC,IPC_ISAEROCOMPOSITIONACTIVE,IPC_USE_UXTHEME_FUNC);
  1968. */
  1969. #define IPC_GET_PLAYING_TITLE 3034
  1970. // returns wchar_t * of the current title
  1971. #define IPC_CANPLAY 3035
  1972. // pass const wchar_t *, returns an in_mod * or 0
  1973. typedef struct {
  1974. // fill these in...
  1975. size_t size; // init to sizeof(artFetchData)
  1976. HWND parent; // parent window of the dialogue
  1977. // fill as much of these in as you can, otherwise leave them 0
  1978. const wchar_t *artist;
  1979. const wchar_t *album;
  1980. int year, amgArtistId, amgAlbumId;
  1981. int showCancelAll; // if set to 1, this shows a "Cancel All" button on the dialogue
  1982. // winamp will fill these in if the call returns successfully:
  1983. void* imgData; // a buffer filled with compressed image data. free with WASABI_API_MEMMGR->sysFree()
  1984. int imgDataLen; // the size of the buffer
  1985. wchar_t type[10]; // eg: "jpg"
  1986. const wchar_t *gracenoteFileId; // if you know it
  1987. } artFetchData;
  1988. #define IPC_FETCH_ALBUMART 3036
  1989. /* pass an artFetchData*. This will show a dialog guiding the use through choosing art, and return when it's finished
  1990. ** return values:
  1991. ** 1: error showing dialog
  1992. ** 0: success
  1993. ** -1: cancel was pressed
  1994. ** -2: cancel all was pressed
  1995. */
  1996. #define IPC_JSAPI2_GET_DISPATCH_OBJECT 3037
  1997. /* pass your service's unique ID, as a wchar_t * string, in wParam
  1998. ** Winamp will copy the string, so don't worry about keeping it around
  1999. ** An IDispatch * object will be returned (cast the return value from SendMessage)
  2000. ** This IDispatch can be used for scripting/automation/VB interaction
  2001. ** Pass to IE via IDocHostUIHandler::GetExternal and it will become window.external in javscript
  2002. */
  2003. #define IPC_REGISTER_WINAMP_IPCMESSAGE 65536
  2004. /* (requires Winamp 5.0+)
  2005. ** DWORD id = SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)name,IPC_REGISTER_WINAMP_IPCMESSAGE);
  2006. ** The value 'id' returned is > 65536 and is incremented on subsequent calls for unique
  2007. ** 'name' values passed to it. By using the same 'name' in different plugins will allow a
  2008. ** common runtime api to be provided for the currently running instance of Winamp
  2009. ** e.g.
  2010. ** PostMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)my_param,registered_ipc);
  2011. ** Have a look at wa_hotkeys.h for an example on how this api is used in practice for a
  2012. ** custom WM_WA_IPC message.
  2013. **
  2014. ** if(uMsg == WM_WA_IPC && lParam == id_from_register_winamp_ipcmessage){
  2015. ** // do things
  2016. ** }
  2017. */
  2018. #endif//_WA_IPC_H_