Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing ProcessSpyForm.frm (5.60 KB)
VERSION 5.00
Begin VB.Form ProcessSpyForm
BorderStyle = 3 'Fixed Dialog
Caption = "Process Spy"
ClientHeight = 2355
ClientLeft = 45
ClientTop = 330
ClientWidth = 7455
ClipControls = 0 'False
Icon = "ProcessSpyForm.frx":0000
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2355
ScaleWidth = 7455
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CheckBox Check1
Caption = "&Lowercase All Processes"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 2
Top = 2040
Width = 5535
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
HideSelection = 0 'False
Left = 120
MaxLength = 260
TabIndex = 0
Top = 120
Width = 5535
End
Begin VB.CommandButton Command3
Caption = "Close"
Default = -1 'True
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5760
TabIndex = 5
Top = 1480
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "&Terminate Process"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5760
TabIndex = 4
Top = 1000
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "&Refresh"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5760
TabIndex = 3
Top = 520
Width = 1575
End
Begin VB.ListBox List1
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1425
ItemData = "ProcessSpyForm.frx":000C
Left = 120
List = "ProcessSpyForm.frx":000E
Sorted = -1 'True
TabIndex = 1
Top = 480
Width = 5535
End
End
Attribute VB_Name = "ProcessSpyForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim NoChange As Boolean
Private Sub Check1_Click()
Command1_Click
End Sub
Private Sub Command1_Click()
Dim i As Long
Dim ProcessExeList() As String
Dim ProcessThreadList() As Long
GetProcesses ProcessExeList(), ProcessThreadList()
List1.Clear
Text1.Text = ""
Command2.Enabled = False
For i = LBound(ProcessExeList) To UBound(ProcessExeList)
List1.AddItem IIf(Check1.Value = 1, LCase(ProcessExeList(i)), ProcessExeList(i))
List1.ItemData(List1.NewIndex) = ProcessThreadList(i)
Next i
End Sub
Private Sub Command2_Click()
Dim M As VbMsgBoxResult
M = MsgBox("Are you sure you want to terminate this process?", vbQuestion + vbYesNo, "Process Spy")
If M = vbNo Then Exit Sub
If EndProcess(List1.ItemData(List1.ListIndex)) Then
MsgBox "The process was terminated successfully.", vbExclamation, "Process Spy"
Else
MsgBox "The process was unable to be terminated.", vbExclamation, "Process Spy"
End If
Command1_Click
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
NoChange = False
Command1_Click
End Sub
Private Sub List1_Click()
Command2.Enabled = True
If NoChange = False Then
Text1.Text = List1.List(List1.ListIndex)
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End If
End Sub
Private Sub Text1_Change()
Dim i As Integer
If List1.ListCount = 0 Then Exit Sub
For i = 0 To List1.ListCount - 1
If Left(LCase(List1.List(i)), Len(Text1.Text)) = LCase(Text1.Text) Then
NoChange = True
List1.ListIndex = i
NoChange = False
Exit For
End If
Next i
End Sub