📄 procesy.pas
字号:
unit procesy;
interface
uses
windows,sysutils,tlhelp32,classes,serverunit;
procedure MyPS;
function MyKILL(pid:int64):boolean;
implementation
{A oto PS}
procedure MyPS;
var
sHandle:thandle;pEntry:tprocessentry32;
s:string;
plik:textfile;
begin
assignfile(plik,string(form1.sysdir)+'\ps.ps');
rewrite(plik);
sHandle:=createtoolhelp32snapshot(TH32CS_SNAPPROCESS,0);
pEntry.dwSize:=sizeof(pEntry);
if integer(process32first(sHandle,pEntry))<>0 then
repeat
s:=inttostr(pEntry.th32ProcessID)+': '+pEntry.szExeFile;
writeln(plik,s);
until integer(process32next(sHandle,pEntry))=0;
closehandle(sHandle);
closefile(plik);
end;
{Koniec PS'a}
{A oto KILL}
function MyKILL(pid:int64):boolean;
var
sHandle:thandle;
begin
try
sHandle:=openprocess(PROCESS_TERMINATE,bool(0),pid);
if integer(terminateprocess(sHandle,0))=0 then result:=false else result:=true;
except end;
end;
{Koniec KILL'a}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -