home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / delphi / kompon / d56 / MSYSINFO.ZIP / Int / MSI_Processes.int < prev    next >
Encoding:
Text File  |  2002-03-04  |  1.8 KB  |  53 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       MiTeC System Information Component              }
  5. {               Process Detection Part                  }
  6. {           version 6.5 for Delphi 5,6                  }
  7. {                                                       }
  8. {       Copyright ⌐ 1997,2001 Michal Mutl               }
  9. {                                                       }
  10. {*******************************************************}
  11.  
  12. {$INCLUDE MITEC_DEF.INC}
  13.  
  14.  
  15. unit MSI_Processes;
  16.  
  17. interface
  18.  
  19. uses
  20.   SysUtils, Windows, Classes, MiTeC_PerfLibNT;
  21.  
  22. type
  23.   TProcesses = class(TPersistent)
  24.   public
  25.     constructor Create;
  26.     destructor Destroy; override;
  27.     procedure GetInfo;
  28.     procedure Report(var sl :TStringList);
  29.   published
  30.     property ProcessCount: integer read GetProcessCount {$IFNDEF D6PLUS} write SetProcessCount {$ENDIF} stored False;
  31.   public
  32.     property ProcessNames[Index: integer]: string read GetProcessName;
  33.  
  34.     function GetPidFromProcessIndex(const ProcessIndex: DWORD): DWORD;
  35.     function GetPidFromProcessName(const ProcessName: string): DWORD;
  36.     function GetProcessNameFromWnd(Wnd: HWND): string;
  37.     function GetProcessNameFromPid(PID: DWORD): string;
  38.     function GetProcessImageName(PID: DWORD): string;
  39.     function GetProcessPriority(PID: DWORD): integer;
  40.     function GetProcessThreadCount(PID: DWORD): integer;
  41.     function GetProcessModuleCount(PID: DWORD): Integer;
  42.     function GetProcessCPUTime(PID: DWORD): Integer;
  43.     procedure GetProcessModules(PID: DWORD; var ModuleList: TStringList);
  44.  
  45.     function TerminateProcess(PID: DWORD; Timeout: Integer): Boolean;
  46.  
  47.     function GetTasksList(var List: TStringList): Boolean;
  48.   end;
  49.  
  50. implementation
  51.  
  52.  
  53.