VB如何限制指定软件运行

来源:百度知道 编辑:UC知道 时间:2024/05/09 08:52:10
VB如何限制指定软件运行
就是用VB编写个小程序
软后里面可以自己设置想限制运行的程序 并且可以隐藏的(只在进程李显示)
我上次看到过 现在找不到了 。。。

Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) 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 TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Const Process_Query_Information = &H400
Private Const Still_Active = &H103

Dim hProcess As Long, hProcess1 As Long
Dim Counter As Integer
Dim strs() As String

Private Sub Form_Load()
Dim cmd As String
Dim i As Integer
cmd = "<程序路径>"
PID = Shell(cmd,[参数(vbHide之类的,可选)])
Counter = 0 '计数器
hProcess = OpenProcess(Process_Query_Information, False, PID)
hProcess1 = Open