27. März 2008 10:53
27. März 2008 11:23
27. März 2008 12:05
WmiProccessRunning(pHost : Text[30];pExefile : Text[100]) pRunning : Boolean
----------------------------------------------------------------------------
# oWmiSWbemLocator Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemLocator
# oWmiSWbemServices Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemServices
# oWmiSWbemObjectSet Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemObjectSet
# lSelect Text 250
// WmiProccessRunning : läuft Programm (Task) ?
IF pHost = '' THEN
pHost := '.';
IF ISCLEAR(oWmiSWbemLocator) THEN
CREATE(oWmiSWbemLocator);
oWmiSWbemServices := oWmiSWbemLocator.ConnectServer(pHost);
lSelect := STRSUBSTNO ('select name, description from Win32_Process where name="%1"', pExefile)
oWmiSWbemObjectSet := oWmiSWbemServices.ExecQuery(lSelect);
IF (oWmiSWbemObjectSet.Count > 0) THEN
pRunning := TRUE
ELSE
pRunning := FALSE;
WmiProccessRunningCount(pHost : Text[30];pExefile : Text[100]) : Integer
----------------------------------------------------------------------------
# oWmiSWbemLocator Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemLocator
# oWmiSWbemServices Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemServices
# oWmiSWbemObjectSet Automation 'Microsoft WMI Scripting V1.2 Library'.SWbemObjectSet
# lSelect Text 250
// WmiProccessRunningCount : wie häufig läuft Programm (Task) ?
IF pHost = '' THEN
pHost := '.';
IF ISCLEAR(oWmiSWbemLocator) THEN
CREATE(oWmiSWbemLocator);
oWmiSWbemServices := oWmiSWbemLocator.ConnectServer(pHost);
lSelect := STRSUBSTNO ('select name, description from Win32_Process where name="%1"', pExefile);
oWmiSWbemObjectSet := oWmiSWbemServices.ExecQuery(lSelect);
EXIT (oWmiSWbemObjectSet.Count);
WmiProccessRunning('','Excel.exe'); // läuft Excel auf diesem Rechner
27. März 2008 12:14
28. März 2008 13:40