{Various Music Playing Routines from Anthony } unit music; interface uses windows; var play : pointer; function Createit(parms : string) : pointer;stdcall;external 'npmod32.dll' name 'ModPlug_CreateEx'; {give her sum life!} function loadit(plug : pointer;filename : string) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_Load'; {load her} function playit (it : pointer) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_Play'; {play it!} function setw(plug : pointer;hand : hwnd) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_SetWindow'; {assigns the plugin to the control} function isread(plug : pointer) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_IsReady'; {am i ready to rocknroll?} function destroyit(plug : pointer) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_Destroy'; {destroys pointer and player} function stopit(plug : pointer) : boolean;stdcall;external 'npmod32.dll' name 'ModPlug_Stop'; {stops the mod player} function setpos(plug : pointer; pos : word) : word;stdcall;external 'npmod32.dll' name 'ModPlug_SetCurrentPosition'; {set position} function getmaxpos(plug : pointer) : word;stdcall;external 'npmod32.dll' name 'ModPlug_GetMaxPosition'; {position} function getcurpos(plug : pointer) : word;stdcall;external 'npmod32.dll' name 'ModPlug_GetCurrentPosition'; {position} procedure badload; implementation uses dwnlod,messages,sysutils,classes,controls,forms,dialogs; procedure badload; begin showmessage('Weather Daemon Had Trouble Loading the file to be played.'); halt; end; end. Example of how to load and play a mod file below play := nil; play := createit('hidden|false|width|100|height|100|loop|true|'); setw(play,groupbox1.handle); { Very important. You can use any control just about as you like, however i recommend a group box.} loadit(play,'k_fare.it'); setpos(play,0); if isread(play) = false then badload; playit(play); stopit(play); destroyit(play);