Hi, I made a plugin for a mp3 player that I made.
the dll code looks like this:
What it does is simply change the Personal message in MSN to what song I'm listening to in my mp3player.
This is how it calls the dll from inside the mp3player
and in for example the play button code I have
Now, what I want to do to call the DLL from a button instead of including it when the program starts.
So I could remove the .dll without the mp3player complaining about it when I start the program.
Like, instead of using procedure DllMessage; external 'CallMsnDLL.dll'
it should search for the dll and if it doesnt find it, it wont use CurrentPlay(ExtractFileName(MediaPlayer1.FileName)); in the play button...
Anyone has any ideas or snippets about this?
Please write here if you need any more information
the dll code looks like this:
Code:
library CallMSNDLL;
uses
SysUtils,
Classes,
Windows,
Messages,
uFMOD;
{$R *.res}
function CurrentPlay(ARTIST:string) : string; Export;
var
handleMSN:THandle;
structCopy:TCopyDataStruct;
stringBuffer:array [0..127] of WideChar;
begin
FillChar(stringBuffer,SizeOf(stringBuffer),#0);
StringToWideChar('\0Music\0'+'1'+'\0'+'{0} **AntePlug1.0**'+'\0'+ARTIST+'\0'+'WMContentID'+#0,@stringBuffer[0],128);
FillChar(structCopy,SizeOf(TCopyDataStruct),#0);
with structCopy do
begin
cbData:=SizeOf(stringBuffer);
dwData:=$547;
lpData:=@stringBuffer[0];
end;
handleMSN:=FindWindowEx(0,0,'MsnMsgrUIManager',nil);
while handleMSN <> 0 do
begin
SendMessage(handleMSN,WM_COPYDATA,0,Integer(@structCopy));
handleMSN:=FindWindowEx(0,handleMSN,'MsnMsgrUIManager',nil);
end;
end;
Exports CurrentPlay;
begin
end.
What it does is simply change the Personal message in MSN to what song I'm listening to in my mp3player.
This is how it calls the dll from inside the mp3player
Code:
procedure DllMessage; external 'CallMsnDLL.dll'
and in for example the play button code I have
Code:
CurrentPlay(ExtractFileName(MediaPlayer1.FileName));
Now, what I want to do to call the DLL from a button instead of including it when the program starts.
So I could remove the .dll without the mp3player complaining about it when I start the program.
Like, instead of using procedure DllMessage; external 'CallMsnDLL.dll'
it should search for the dll and if it doesnt find it, it wont use CurrentPlay(ExtractFileName(MediaPlayer1.FileName)); in the play button...
Anyone has any ideas or snippets about this?
Please write here if you need any more information