What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! General » Change state when a specific program starts

Change state when a specific program starts
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Change state when a specific program starts
Untested but something like this could work...

Javascript code:
// Add the EXE name below
var sExeName = '';var bEnabled = false;
var nPreviousStatus;
 
function OnEvent_Initialize() {
    if (Messenger.MyStatus < STATUS_OFFLINE) return false;
    MsgPlus.AddTimer('_ExeCheck', 100);
}
 
function OnEvent_SigninReady() {
    OnEvent_Initialize();
}
 
function OnEvent_Timer(sTimerId) {
    if (GetProcessName() === true && bEnabled === false) {
        bEnabled = true;
        nPreviousStatus = Messenger.MyStatus;
        Messenger.MyStatus = STATUS_BUSY
    } else if (GetProcessName() === false && bEnabled === true) {
        bEnabled = false;
        Messenger.MyStatus = nPreviousStatus;
    }
    MsgPlus.AddTimer('_ExeCheck', 100);
}
 
function GetProcessName(){
    return new ActiveXObject("WbemScripting.SWbemLocator").ConnectServer(".", "root\\cimv2").ExecQuery("SELECT * FROM Win32_Process WHERE Name LIKE '%" + sExeName + "%'").Count !== 0;
}


This post was edited on 05-10-2011 at 04:56 PM by matty.
05-10-2011 04:55 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Change state when a specific program starts - by SuperAs on 05-10-2011 at 03:38 PM
RE: Change state when a specific program starts - by matty on 05-10-2011 at 04:55 PM
RE: RE: Change state when a specific program starts - by SuperAs on 05-11-2011 at 11:41 AM
RE: Change state when a specific program starts - by matty on 05-11-2011 at 05:26 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On