Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 5 odgovora
  • 4.490 pregleda

Najnovija ↓

Re: Prikaz svih trenutnih procesa 09.12.2004. u 11:43 · pre 266 meseci #2
http://www.softver.org.mk/stara/index2.php?vidi=proekti/mk_ps.php

Ne secam se samo dali je to BCB ili Delphi, u svakom slucaju to je to sto trazis, samo analiziraj source.
Potpis
People who think they know everything tend to irritate those of us who do.
Re: Prikaz svih trenutnih procesa 13.12.2004. u 00:11 · pre 266 meseci #6
Code:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

const
  TH32CS_SNAPPROCESS  = $00000002;

type

  PPROCESSENTRY32 = ^TPROCESSENTRY32;
  TPROCESSENTRY32 = packed record
    dwSize,
    cntUsage,
    th32ProcessID,
    th32DefaultHeapID,
    th32ModuleID,
    cntThreads,
    th32ParentProcessID: DWORD;
    pcPriClassBase: LongInt;
    dwFlags: DWORD;
    szExeFile: array[0..MAX_PATH-1] of char;
  end;

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  function CreateToolhelp32Snapshot(dwFlags, th32ProcessID: DWORD): THandle; stdcall; external 'kernel32.dll' name 'CreateToolhelp32Snapshot';
  function Process32First(hSnapshot: THandle; const lppe: TPROCESSENTRY32): boolean; stdcall;external 'kernel32.dll' name 'Process32First';
  function Process32Next(hSnapshot: THandle; const lppe: TPROCESSENTRY32):  boolean; stdcall;external 'kernel32.dll' name 'Process32Next';

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  snap: THandle;
  tmp: string;
  me: TPROCESSENTRY32;
  r: integer;
begin
  snap := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
  me.dwSize := SizeOf(TPROCESSENTRY32);

  if Process32First(snap,me)=true then ShowMessage('ok');
  while Process32Next(snap,me)=true do
  begin
    tmp := '';
    r := 0;
    while me.szExeFile[r]<>#0 do
    begin
      tmp := tmp + me.szExeFile[r];
      inc(r);
    end;   
    MessageBox(0,pchar(tmp),'hehe:)',0);
  end;
end;
end.


;)
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme