How to make plugins work nicely under nad and winamp ----------------------------------------------------- Write a plugin that 'attaches' itself to the calling app window, or just simply want to change the text the window displays so people using the plugin think more of it?? Well these simple instructions will help you do just that. Or at the least it will let you bring up a dialog that says 'nad stinks' or something :P The code you need to know ------------------------- When nad is about to call your module Init() code, it sets the userdata of the window which you can use to detect its running. 1> its sets its own window UserData to the hex value 0x004e4144, (this is the ascii hex value for 'nad'(with a leading null). so in your plugin you can call if(GetWindowLong(TheModule->hwndParent, GWL_USERDATA) == 0x004e4144) IsNad = TRUE; that should work and you can use different code somewhere to do whatever it takes to make your plugin work with nad! Nad Extensions to the Winamp Plugin Format ------------------------------------------ all messages are sent to the Parent window from the winampvismodule structure... #define WM_PLUGIN_ATTACHWINDOW WM_APP + 0x0400 /* lParam points to your window. Sending this message means your plugin will receive messages to the window you specify (see below for the messages you will receive*/ // for the following messages use SendMessage and get the return value #define WM_PLUGIN_GETCURRENTTIME WM_APP + 0x0402 // time in seconds #define WM_PLUGIN_GETBITRATE WM_APP + 0x0403 #define WM_PLUGIN_GETSAMPLEFREQ WM_APP + 0x0404 #define WM_PLUGIN_GETSYNCSTATUS WM_APP + 0x0405 // see below for possible return values #define WM_PLUGIN_GETPLAYSTATUS WM_APP + 0x0406 // '' '' '' '' '' '' #define WM_PLUGIN_GETUPDATERATE WM_APP + 0x0407 // number of FPS #define WM_PLUGIN_INWINDOWACTIVE WM_APP + 0x0408 /* Makes nad turn off display into the big boxso your plugin can draw into this window.. the dimensions are 147x42 at an offset of */ #define WM_PLUGIN_WINDOW_MESSAGE WM_APP + 0x0409 /* lParam points to NULL terminated message.. This message allows you to put a message in the main nad window song display for 3seconds or so..*/ If you use the WM_PLUGIN_ATTACHWINDOW message your plugin window will receive the following messages #define WM_TIME WM_APP + 0x0201 #define WM_PLAYING WM_APP + 0x0205 #define WM_STOPPED WM_APP + 0x0206 #define WM_SYNC_STATUS WM_APP + 0x0207 these are the values from WM_PLUGIN_GETPLAYSTATUS #define PLAYING 0 #define PAUSED 1 #define STOPPED 2 these are the values from WM_PLUGIN_GETSYNCSTATUS and WM_SYNC_STATUS #define SYNC_GOOD 0 #define SYNC_BAD 1 #define SYNC_SKIPWAV 2