Dani Amarullah

Just Try in Error

View Process & Kill

Hmmm Bete ga puguh mending aja sigw post lagi dechhh,wekekekekek….
sekarang si gw maubagi2 lagi artikel yang si gw dah kumpulin dan mau berbagi dengan teman2..hehehehe yaitu buat aplikasi untuk melihat semua prosess di windows yang sedang berjalan wokeyyy, serta untuk meng KILL nya,wakakakakaka…
langsung aja ke TKP,wakakakaka… pertama biasa

siapkan :

  1. Cemilan
  2. Roko
  3. Kopi
  4. Winamp
  5. dan Berdoa jangan lupa,hehehehe

Ok langsung aja buka delphi nya brooooooo
Ini Source nya broooooo(cuma dikit ko listing nya,wekekekekkekee)….

unit Unit1;

interface

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

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

var
  Form1: TForm1;
  x,a : integer;
  CaptionApplication : String;

implementation

{$R *.dfm}

function KillTask(ExeFileName: string): Integer;
const
  PROCESS_TERMINATE = $0001;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  Result := 0;
  FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
  FProcessEntry32.dwSize:=SizeOf(FProcessEntry32);
  ContinueLoop:=Process32First(FSnapshotHandle,FProcessEntry32);
  while Integer(ContinueLoop)0 do  begin
  if (
     (UpperCase(ExtractFileName(FProcessEntry32.szExeFile))=
       UpperCase(ExeFileName))
      or
     (UpperCase(FProcessEntry32.szExeFile)=
       UpperCase(ExeFileName))
    ) then
    Result :=
    Integer(
      TerminateProcess(
      OpenProcess(
        PROCESS_TERMINATE,
        BOOL(0),
        FProcessEntry32.th32ProcessID
      ),
      0
      )
    );
   ContinueLoop:=Process32Next(FSnapshotHandle,FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;

procedure TForm1.Button1Click(Sender: TObject);
Var
  MyHandle: THandle;
  Struct: TProcessEntry32;
begin
  ListBox2.Clear;
  if listbox2.ItemIndex < 0 then
  listBox2.itemindex := 0;
  MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
  Struct.dwSize:=Sizeof(TProcessEntry32);
  if Process32First(MyHandle, Struct) then
  ListBox2.Items.Add(Struct.szExeFile);
  while Process32Next(MyHandle, Struct) do
  ListBox2.Items.Add(Struct.szExeFile);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  if ListBox2.ItemIndex >= 0 then
  begin
  CaptionApplication:=ListBox2.Items.Strings[listBox2.itemindex];
  if CaptionApplication  '' then
  begin
    KillTask(CaptionApplication);
    Button1.Click;
  end
  else
    Button1.Click;
  end;
    Button1.Click;
end;

end.
Syntax Highlighted with http://delphi-id.org/syntax

bisa didonlot semua source di sini —-> Download here…

SkrinSuuut nya…
taskmanager.jpg

Beressss deh, semoga bermanfaat ya brooooo….Wakakakakaaaaa

July 20, 2007 - Posted by p2bf | Artikelah, D3lPhE | | 2 Comments

2 Comments »

  1. kok WinAmp nya kagak kliatan di skrinsut nya ??
    khan salah satu alat yg di bawa ke TKP…
    :)

    btw..
    pengguna sgitiga ijo alias idm jg neh..
    ;-)

    Comment by oRiDo | November 14, 2007 | Reply

  2. ooh.. in toh mas jack_the_ripper itu… hehe

    lm knl ya….

    ajarin delphi duunn.. ^_^

    Comment by wong_udik | December 24, 2007 | Reply


Leave a comment