cirix
New Member
Posts: 10
Joined: Jun 2006
|
RE: [Question] Now playing/Display picture.
Here is the scrip, Im onli having a problem with the second time I dont know whats wrong, the problem is that I need a pause between executing samurizeserver and setting the DP notice the quoted parts:
quote: var objShell = new ActiveXObject("Shell.Application");
var one;
var changemedia;
var two;
function OnEvent_MyMediaChange(changemedia){
playerHwnd = Interop.Call('User32','FindWindowW','Winamp v1.x',0);
var lBuffer = Interop.Call('user32', 'GetWindowTextLengthW', playerHwnd)+1;
var sBuffer = Interop.Allocate(2*(lBuffer+2));
var Title = Interop.Call('user32', 'GetWindowTextW', playerHwnd, sBuffer, lBuffer);
one = sBuffer.ReadString(0);
Debug.Trace('sBuffer: '+ one );
//Debug.Trace('sBuffer: '+sBuffer.ReadString(0));
objShell.ShellExecute('C:\\Program Files\\Samurize\\SamurizeServer.exe', "i=mcover c=msnc.ini close", "", "", 1);
MsgPlus.AddTimer ("check",3000);
}
function OnEvent_Timer(TimerId)
{
if (TimerId == "check")
{
Debug.Trace( one);
var lBuffer = Interop.Call('user32', 'GetWindowTextLengthW', playerHwnd)+1;
var sBuffer = Interop.Allocate(2*(lBuffer+2));
var Title = Interop.Call('user32', 'GetWindowTextW', playerHwnd, sBuffer, lBuffer);
two = sBuffer.ReadString(0);
Debug.Trace('sBuffer: '+ two + one);
if (two == one)
{
objShell.ShellExecute('C:\\Program Files\\Samurize\\SamurizeServer.exe', "i=mcover c=msnc.ini", "", "", 1);
//MsgPlus.AddTimer ("samur",2000);
}
//function OnEvent_Timer(TimerId)
//{
//if (TimerId == "samur")
//{
//Debug.Trace('CHANGE ');
//Messenger.MyDisplayPicture = "C:\\Program Files\\Samurize\\samurizeoutput.png";
//objShell.ShellExecute('C:\\Program Files\\Samurize\\SamurizeServer.exe close', "i=mcover c=msnc.ini -close", "", "", 1);
//}
//}
}
}
function OnEvent_Uninitialize(MessengerExit)
{
objShell.ShellExecute('C:\\Program Files\\Samurize\\SamurizeServer.exe', "i=mcover c=msnc.ini trayiconvisible=0 close", "", "", 1);
}
This post was edited on 06-29-2006 at 06:56 PM by cirix.
|
|