Einzelnen Beitrag anzeigen

Benutzerbild von Jelly
Jelly

Registriert seit: 11. Apr 2003
Ort: Moestroff (Luxemburg)
3.741 Beiträge
 
Delphi 2007 Professional
 
#3

Re: Herausfinden welche Tasks liefen und was am PC gemacht w

  Alt 9. Jul 2006, 13:17
Die Prozesse auflisten kannst Du so:

Delphi-Quellcode:
procedure TForm1.ListProcesses (Listview1 : TListView) ;
var
  i: Integer;
  bContinue: BOOL;
  NewItem: TListItem;
  aSnapshotHandle: THandle;
  aProcessEntry32: TProcessEntry32;
begin
  ListView1.Items.Clear;
  aSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  aProcessEntry32.dwSize := SizeOf(aProcessEntry32);
  bContinue := Process32First(aSnapshotHandle, aProcessEntry32);
  while Integer(bContinue) <> 0 do
  begin
    NewItem := ListView1.Items.Add;
    NewItem.Caption := ExtractFileName(aProcessEntry32.szExeFile);
    NewItem.subItems.Add(IntToHex(aProcessEntry32.th32ProcessID, 4));
    //NewItem.subItems.Add(aProcessEntry32.szExeFile);
    bContinue := Process32Next(aSnapshotHandle, aProcessEntry32);
  end;
  CloseHandle(aSnapshotHandle);
end;
Was willst Du denn eigentlich genau machen.
  Mit Zitat antworten Zitat