Функция получения списка процессов:
| Код | function GetProcessList: TStringlist; var hSnap:THandle; pe:TProcessEntry32; begin Result:=TStringlist.Create; pe.dwSize:=SizeOf(pe); hSnap:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); If Process32First(hSnap,pe) then begin If (pe.szExeFile<>'[System Process]') and (pe.szExeFile<>'System') then Result.Add(pe.szExeFile); While Process32Next(hSnap,pe) do begin If (pe.szExeFile<>'[System Process]') and (pe.szExeFile<>'System') then Result.Add(pe.szExeFile); end; end; end;
|
Поиск нужного процесса в списке:
| Код | var A: TStringList; P: Integer; begin A:=TStringList.Create; A:=GetProcessList; if A.IndexOf('prrroq.exe')>0 then p:=1;
|
Если не хрена не работает, попробуй добавить в раздел uses TLHelp32. |