paddygamer
New member
- Joined
- Oct 13, 2009
- Messages
- 3
- Programming Experience
- Beginner
Okay i am trying to write a little program that checks for a process and kills is.
here is the code:
My problem is it´s woking ,yes if the programm ,,Cheat Engine" is running the process is getting killed.
But if the program is not running my program crashes. I do not have any Idea how to fix this. I hope you high-skillers can help me out.
(i am ussing VB 2008)
here is the code:
VB.NET:
Dim p As Process = Process.GetProcessesByName("Cheat Engine")(0)
p.CloseMainWindow()
Threading.Thread.Sleep(500)
If Process.GetProcessesByName("Cheat Engine").Length > 0 Then
p.Kill()
End If
End Sub
My problem is it´s woking ,yes if the programm ,,Cheat Engine" is running the process is getting killed.
But if the program is not running my program crashes. I do not have any Idea how to fix this. I hope you high-skillers can help me out.
(i am ussing VB 2008)