Hello,
I've modified the "AppMon" script, but I don't understand why there's a Wordobject, I know what it does (make a list of processes), but not why Word is used. It takes a lot from my computer, so is there a way to do it on a different way?
code:
var monitorTime = 1000;
var prename = false;
var premsg = false;
var prestat = 0;
try{
var objWord = new ActiveXObject('Word.Application');
}catch(e){
objWord = new Object;
objWord.Tasks = function(){
var Exists = function(){
return false;
}
}
objWord.Fake = true;
}
var MsgStatus = ["Don't Change", "Offline", "Appear Offline", "Online", "Busy", "Be Right Back", "Idle", "Away", "In A Call", "Out to Lunch"];
function OnEvent_Initialize(MessengerStart){
MsgPlus.AddTimer ("app_monitor", monitorTime);
}
function OnEvent_Uninitialize(MessengerExit){
objWord.Quit();
}
function OnEvent_Timer(TimerId){
if (TimerId == 'app_monitor'){
var colTasks = objWord.Tasks;
if(colTasks.Exists("Microsoft Visual Basic 2008 Express Edition")){
var name = colTasks("Microsoft Visual Basic 2008 Express Edition").Name;
if (name != prename){
var RE = new RegExp("^(.+)\ - Microsoft Visual Basic 2008 Express Edition$",'i');
if (!prename){
premsg = Messenger.MyPersonalMessage;
}
Messenger.MyPersonalMessage = name.replace(RE, "Op dit moment ben ik programmerende met '$1' (Realtime gegevens)");
prename = name;
}
} else {
Messenger.MyPersonalMessage = "Op dit moment ben ik niet aan het programmeren (Realtime gegevens)";
}
}
MsgPlus.AddTimer ("app_monitor", monitorTime);
}
Kind regards,
Thomas