I am developping a Windows Service in Visual Basic, witch will start an *.exe when starting. It's working pretty fine. Now how can I stop this *.exe while stopping this windows service? My code is as below:
Public Class MyWinService
Dim RetVal
Protected Overrides Sub OnStart(ByVal args() As String)
EventLog.WriteEntry("MyService Started")
RetVal = Shell("JobService.exe", 1)
End Sub
Protected Overrides Sub OnStop()
EventLog.WriteEntry("MyService Stopped")
End Sub
Protected Overrides Sub OnPause()
EventLog.WriteEntry("MyService Paused")
End Sub
Protected Overrides Sub OnContinue()
EventLog.WriteEntry("MyService Resumed")
End Sub
Protected Overrides Sub OnCustomCommand(ByVal command As Integer)
If command = 200 Then
EventLog.WriteEntry("Custom Command 200 invoked")
ElseIf command = 210 Then
EventLog.WriteEntry("Custom Command 210 invoked")
End If
End Sub
Private Sub Process1_Exited(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
End Class