I changed the class on VB Slightly
Code:
Public Function Process_Handle_Byname(ProcessName As String) As Boolean
Try
Dim ProcList As Process() = Process.GetProcessesByName(ProcessName)
If ProcList.Length = 0 Then
Return False
Else
pHandel = ProcList(0).Handle
Return True
End If
Catch ex As Exception
Console.Beep()
Console.WriteLine("Process_Handle - " + ex.Message)
Return False
End Try
End Function
Public Function Process_Handle_Byid(ProcessName As Integer) As Boolean
Try
pHandel = Process.GetProcessById(ProcessName).Handle
Return True
Catch ex As Exception
Console.Beep()
Console.WriteLine("Process_Handle - " + ex.Message)
Return False
End Try
End Function
This allows for handling by process id (in case of multiple copies of game open, etc.)
Usage
Code:
ComboBox1.Items.Clear()
For Each p As Process In Process.GetProcessesByName("Game")
ComboBox1.Items.Add(p.Id)
Next
Code:
If hack.Process_Handle_Byid(Process.GetProcessById(ComboBox1.Text).Id) Then
end if