[Delphi] Function ProcessIsRunning
Publicado: 09 Jul 2010, 23:14
Código: Seleccionar todo
Uses
TlHelp32;
function IsRuning(lpzProcess:String):Boolean;
var
TP:TProcessEntry32;
hVal:Cardinal;
hNext:Boolean;
hFirst:LongBool;
begin
hVal:= CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
TP.dwSize:= SizeOf(TP);
hFirst:=Process32First(hVal,TP);
Repeat
begin
If (lpzProcess=TP.szExeFile) Then
Begin
Result:=True;
break;
end;
hNext:=Process32Next(hVal,TP);
end;
Until(Integer(hNext) = 0);
If not Result = True Then Result:=False;
end;
Como siempre! Agradecimientos Thor y Psymera!