VB 如何时时监控一个制定程序的模块~
来源:百度知道 编辑:UC知道 时间:2024/04/29 10:45:59
谢谢~~带注释呕~
OpenProcess打开进程
CreateToolhelp32Snapshot创建快照
module32First和module32Next枚举进程模块
PID自己提供哦,需要实时监视就做个定时器吧
下面是代码
Private Type moduleENTRY32
dwSize As Long
th32moduleID As Long
th32ProcessID As Long
GlblcntUsage As Long
ProccntUsage As Long
modBaseAddr As Byte
modBaseSize As Long
hModule As Long
szModule As String * 256
szExePath As String * 1024
End Type
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long
Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function module32First Lib "kernel32" Alias "Module32First" (ByVal hSnapshot As Long, lppe As moduleENTRY32) As Long
Private Declare Function module32Next Lib