Показать сообщение отдельно
  #7  
Старый 19.11.2010, 14:43
Аватар для PaHaNjkee
PaHaNjkee PaHaNjkee вне форума
Начинающий
 
Регистрация: 13.10.2010
Адрес: Ульяновск
Сообщения: 115
Репутация: 10
По умолчанию

Кидаешь на форму Edit1 и пишешь
Код:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, tlhelp32, StdCtrls, Edit, Button;

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

var
  Form1: TForm1;

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 TForm1Button1Click(Sender: TObject);
begin
killtask(Edit1.text);
end;

end.

т.е вводишь имя процесса в Edit1 и нажимаешь на баттон а послать на ip пользуйся Indy-компонентами
__________________
Начинающий Delphi
Помогаю за Спасибо!
Ответить с цитированием