请问VB如何检索进程?

来源:百度知道 编辑:UC知道 时间:2024/06/26 01:45:39
就是检查当前系统的进程,当发现不允许的进程,就自动结束它

请问如何实现?先谢谢啦

Option Explicit

'添加list3,list2,
Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWnd2 As Long, ByVal X As Long, ByVal Y As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal l As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal n As Long) As Long
Const SHOWS = &H40
Const FLAG = 2 Or 1
Dim asdf As Boolean
Dim theuk As String
Private Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const WM_MOUSEMOVE = &H200
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA"