PoulpHunter
Messages postés51Date d'inscriptionmercredi 11 mai 2005StatutMembreDernière intervention 8 avril 2009 28 juil. 2005 à 23:10
J'ai ajouté le choix de l'icone dans les paramétres...
Sa marche d'enfer mais j'ai essayer de remplacer Music par Empty mais sa a pas marché, domage...
Je crois que sa ne marche qu'avec une certaine version d'MSN...
Sinon en fait j'ai voulu ce code pour faire défiler le titre de la zik ou un fichier texte...
Jvais voir si sa marche (si les autres le voyent en temps réel) et posteré ma réponse ici...
procedure CurrentPlay(ARTIST,ALBUM,TITLE:string;icone:integer);
var
handleMSN : THandle;
structCopy : TCopyDataStruct;
stringBuffer : array [0..127] of WideChar;
icones: string;
begin
FillChar(stringBuffer,SizeOf(stringBuffer),#0);
// Si icone vaut 0 alors MSN Ce que j'écoute sera désactivé
// Si icone:=1 => icone Music
// Si icone:=2 => icone Games
// Si icone:=3 => icone Office
icones:='Music';
if icone>=2 then
begin
icones:='Games';
if icone=3 then
icones:='Office';
icone:=1;
end;
StringToWideChar('\0'+icones+'\0'+inttostr(icone)+'\0'+'{0} - {1}'+'\0'+ARTIST+'\0'+TITLE+'\0'+ALBUM+'\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;