'************************************************************************* '**模 块 名:ModFindProcess '**说 '**创 建 人:马大哈 http://www./ '**日 '**日 '**描 '**版 '************************************************************************* Option Explicit Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapshot As Long, uProcess As PROCESSENTRY32) As Long Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode 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 Const FORMAT_MESSAGE_ALLOCATE_BUFFER = &H100 Private Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000 Private Const TH32CS_SNAPPROCESS As Long = 2& Private Const PROCESS_TERMINATE = 1 Private Type PROCESSENTRY32 End Type Private Type MyProcess End Type Public Function CloseProcess(Optional ByVal ProName As String, Optional ByVal PID As Long) As Integer End Function Public Function FindProcess(ByVal ProName As String, Optional ByRef PID As Long) As Boolean End Function Public Function ListProcess(ByRef ProExeName() As String, ByRef ProPid() As Long) |