I can't believe i've been so stupid
In fact, the functions I use to retrieve the filename are in the windows API, and can be called directly by the script.
dt's Music now playing script helped me alot, and my plugin now works correctly. Thanks everybody.
If someone wants it, it's really simple, if using the Winamp class od dt's script :
function OnEvent_Initialize()
{
MsgPlus.AddTimer("timer",100);
win = new Winamp();
}
var win;
function OnEvent_Timer(TimerId)
{
var filename;
if(win.isOpen()) filename = win.CurrentFilename();
var pos = filename.lastIndexOf("\\");
Messenger.MyDisplayPicture = filename.substring(0,pos) + "\\folder.jpg";
MsgPlus.AddTimer("timer",1000);
}