Форум: "WinAPI";
Текущий архив: 2002.04.15;
Скачать: [xml.tar.bz2];
Внизkill process Найти похожие ветки
← →
Bachin (2002-02-14 13:27) [4]это KILL :)
program kill;
{$APPTYPE CONSOLE}
uses
Windows, SysUtils, Messages;
var
h: THandle;
p: PChar;
begin
if ParamCount = 0 then
begin
WriteLn("kill processID");
Halt(0);
end;
try
h := StrToInt(ParamStr(1));
except
WriteLn("wrong parameter");
Halt(0);
end;
getmem(p, 201);
try
GetWindowText(h, p, 200);
if length(trim(string(p))) > 0 then
begin
WriteLn(Format("close window %d %s", [h, string(p)]));
SendMessage(h, WM_CLOSE, 0, 0);
WriteLn(Format("kill process %d %s", [h, string(p)]));
DestroyWindow(h);
end
else
WriteLn(Format("unknown processID %d", [h]));
finally
freemem(p);
end;
end.
Страницы: 1 вся ветка
Форум: "WinAPI";
Текущий архив: 2002.04.15;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.005 c