Kill 瑞星杀毒软件 的VB代码

Private Declare Function CreateJobObject Lib "kernel32.dll" Alias "CreateJobObjectA" (lpJobAttributes As SECURITY_ATTRIBUTES, lpName As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As String) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function AssignProcessToJobObject Lib "kernel32" (ByVal hJob As Long, ByVal hProcess As Long) As Long
Private Declare Function TerminateJobObject Lib "kernel32" (ByVal hJob As Long, ByVal hProcess As Long) As Long

Private Type SECURITY_ATTRIBUTES
        nLength As Long
        lpSecurityDescriptor As Long
        bInheritHandle As Long
End Type


Private n As SECURITY_ATTRIBUTES
Private h As Long
Private p As Long

Private Sub Command1_Click()
Dim l As Long
Dim pid As Long


l = FindWindow(0, "瑞星杀毒软件")
Print l
GetWindowThreadProcessId l, pid
p = OpenProcess(2035711, 0, pid)
AssignProcessToJobObject h, p
TerminateJobObject h, 0

End Sub

Private Sub Form_Load()
'Dim n As SECURITY_ATTRIBUTES
'Dim h As Long

h = CreateJobObject(n, "Kill")
Debug.Print h


End Sub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值