📄 main1.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form Main1
Caption = "查看进程和模块 BY :adbrave"
ClientHeight = 6675
ClientLeft = 60
ClientTop = 450
ClientWidth = 9960
LinkTopic = "Form1"
ScaleHeight = 6675
ScaleWidth = 9960
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdEnumProc
Caption = "查看"
Height = 495
Left = 1320
TabIndex = 2
Top = 6000
Width = 1935
End
Begin MSComctlLib.ListView LVModule
Height = 5535
Left = 5160
TabIndex = 1
Top = 120
Width = 4575
_ExtentX = 8070
_ExtentY = 9763
LabelWrap = -1 'True
HideSelection = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin MSComctlLib.ListView LVProc
Height = 5535
Left = 120
TabIndex = 0
Top = 120
Width = 4695
_ExtentX = 8281
_ExtentY = 9763
LabelWrap = -1 'True
HideSelection = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
Begin VB.Label lblInfo
Caption = "Label1"
Height = 735
Left = 3840
TabIndex = 3
Top = 5880
Width = 4215
End
End
Attribute VB_Name = "Main1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
LVProc.GridLines = True
LVProc.View = lvwReport
LVProc.FullRowSelect = True
LVProc.LabelEdit = lvwManual
LVProc.Font.Size = 10
With LVProc.ColumnHeaders
.Add , , "ProcName", 2000
.Add , , "ProcID", 1000
End With
LVModule.GridLines = True
LVModule.View = lvwReport
LVModule.FullRowSelect = True
LVModule.LabelEdit = lvwManual
LVModule.Font.Size = 10
With LVModule.ColumnHeaders
.Add , , "Module Name", 2000
.Add , , "Module Address", 7000
End With
cResize Me, True
End Sub
Private Sub Form_Resize()
cResize Me
End Sub
Private Sub cmdEnumProc_Click()
Dim Arr() As String
Dim Brr() As String
Dim i As Long
EnumProc Arr
For i = LBound(Arr) To UBound(Arr)
Brr = Split(Arr(i), Chr(0))
LVProc.ListItems.Add i + 1, , Brr(0)
LVProc.ListItems(i + 1).SubItems(1) = Brr(1)
Next
Me.Caption = "EnumProc 共有:" & LVProc.ListItems.Count & " 个进程"
End Sub
Private Sub LVProc_Click()
If LVProc.ListItems.Count = 0 Then Exit Sub
Me.Caption = "EnumProc " & LVProc.SelectedItem.Index
Dim Arr() As String
Dim Brr() As String
Dim Ret As Long
Dim i As Long
LVModule.ListItems.Clear
Ret = EnumModule(CLng(LVProc.ListItems(LVProc.SelectedItem.Index).SubItems(1)), Arr)
If Ret = 0 Then lblInfo.Caption = "": Exit Sub
For i = LBound(Arr) To UBound(Arr)
Brr = Split(Arr(i), vbCrLf)
LVModule.ListItems.Add i + 1, , Brr(0)
LVModule.ListItems(i + 1).SubItems(1) = Brr(1)
Next
lblInfo.Caption = "选中的是第 " & LVProc.SelectedItem.Index & " 个进程,这个进程共有模块:" & LVModule.ListItems.Count
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -