RE: [VB.Net] [Snippet] Anti-unwanted Process 04-04-2011, 04:14 AM
#4
Thank you for the snippet.
Tested and working great.
What is even more great, is you can add a timer and make it check if any of the apps is running at all time.
Tested and working great.
What is even more great, is you can add a timer and make it check if any of the apps is running at all time.
Code:
Public Class Form1
Sub protect()
Dim AntiProcess() As String = {"notepad", "mspaint", "taskmgr"} 'etc
For intI As Integer = 0 To AntiProcess.GetUpperBound(0)
'Dim procFound As Integer = Process.GetProcessesByName(AntiProcess(intI)).Length
For Each x As Process In Process.GetProcessesByName(AntiProcess(intI))
x.CloseMainWindow() 'or x.Kill()
Next
'If procFound > 0 Then End
Next
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
protect()
End Sub
End Class
(This post was last modified: 04-04-2011, 04:21 AM by BreakR.)