What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » if (program.open)...

if (program.open)...
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: if (program.open)...
code:
function IsProcessRunning(ProcessName){
    var WMI = new ActiveXObject('WbemScripting.SWbemLocator');
    var WMIInstance = WMI.ConnectServer('.', "root\\cimv2");
    var Processes = WMIInstance.ExecQuery("Select * from Win32_Process Where Name = '" + ProcessName + "'");
    return ((Processes.Count > 0) ? true : false);
}

//Example usage
var NotepadRunning = IsProcessRunning("notepad.exe");

EDIT: GeSHi phails :sad:

This post was edited on 01-31-2007 at 05:55 PM by Eljay.
01-31-2007 05:47 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
if (program.open)... - by mad_willsy on 01-31-2007 at 05:26 PM
RE: if (program.open)... - by Eljay on 01-31-2007 at 05:47 PM
RE: if (program.open)... - by mad_willsy on 01-31-2007 at 05:52 PM
RE: if (program.open)... - by hmaster on 01-31-2007 at 05:55 PM
RE: if (program.open)... - by Eljay on 01-31-2007 at 05:57 PM
RE: if (program.open)... - by mad_willsy on 01-31-2007 at 06:00 PM
RE: if (program.open)... - by Eljay on 01-31-2007 at 06:07 PM
RE: if (program.open)... - by mad_willsy on 01-31-2007 at 06:13 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