I need to create an checkbox that closes aplication the after the injection be made
I use code for inject manual
this code no work for inject auto
I discovered
/solved
I use code for inject manual
Code:
If closebox.Checked = True Then
Me.Close()
End If
this code no work for inject auto
Code:
Private Sub TextBoxProcess_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxProcess.TextChanged
If Autoinject.Checked AndAlso tmrAutoInject.Enabled = False Then
tmrAutoInject.Start()
End If
End Sub
Private Sub Autoinject_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Autoinject.CheckedChanged
If Autoinject.Checked Then
tmrAutoInject.Enabled = True
tmrAutoInject.Interval = 100
tmrAutoInject.Start()
Else
tmrAutoInject.Stop()
tmrAutoInject.Enabled = False
End If
End Sub
Private Sub tmrAutoInject_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAutoInject.Tick
Try
TextBoxProcess.Text = TextBoxProcess.Text.Replace(".exe", "")
Dim validProc As Boolean = Process.GetProcessesByName(TextBoxProcess.Text).GetUpperBound(0) + 1
If validProc Then
tmrAutoInject.Stop()
Call inject()
tmrAutoInject.Enabled = False
End If
Catch ex As Exception
MsgBox("An unknown error has occured", MsgBoxStyle.Exclamation, "Warning!")
End Try
If closebox.Checked = True Then
Me.Close()
End If
End Sub
/solved
Why not putting that code in the inject() sub?