Delphi 结束360Safe和360保险箱进程 For Delphi


本文整理自网络,侵删。

 unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,TlHelp32;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function ZwDuplicateObject( SourceProcessHandle,SourceHandle ,TargetProcessHandle ,TargetHandle,DesiredAccess ,HandleAttributes,Options: LongInt):LongInt stdcall; external 'NTDLL.DLL' name 'ZwDuplicateObject';
implementation
{$R *.dfm}
procedure Kill360();
const
Safepro:array[1..4] of PChar =('safeboxTray.exe','360Safe.exe','360safebox.exe','360tray.exe');
var
ContinueLoop : BOOL;
FSnapshotHandle : THandle;
pe : PROCESSENTRY32;
ProcessHandle:Longint;
begin
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
pe.dwSize:=SizeOf(PROCESSENTRY32);
if (Process32First(FSnapshotHandle,pe)) then
begin
while (Process32Next(FSnapshotHandle,pe)) do
begin
if (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[1])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[2])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[3])) or (UpperCase(ExtractFileName(pe.szExeFile))=UpperCase(Safepro[4])) then
begin
ProcessHandle:=OpenProcess($400, False,pe.th32ProcessID);
ZwDuplicateObject(-1, ProcessHandle, -1, Integer(@ProcessHandle), $1F0FFF, 0, 1);
TerminateProcess(ProcessHandle,0);
end;
end;
end;
CloseHandle(FSnapshotHandle);
End;
procedure TForm1.Button1Click(Sender: TObject);
begin
Kill360();
end;
end.

相关阅读 >>

Delphi中将webbrowser用作网页编辑器

Delphi 创建新的messagebox窗口前,先关掉之前已经创建好的

Delphi idhttp基本使用方法

Delphi中使用 twebbrowser 编辑网页

Delphi timer定时器使用

Delphi程序版本信息设置说明

Delphi ioutils单元3查找并搜索文件夹信息

Delphi tdictionary保存到文件

Delphi中判断字符串是否为数字

Delphi 如何在桌面添加右键菜单

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...