Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
test
StartMessageLoop
End Sub
Private Sub test
Wait For (CheckWhetherJavaAppIsRunning("aa.bb")) Complete (Running As Boolean)
Log("running: " & Running)
End Sub
Private Sub CheckWhetherJavaAppIsRunning (ProgramName As String) As ResumableSub
Dim shl As Shell
shl.Initialize("shl", File.Combine(GetSystemProperty("java.home", ""), "bin\jps.exe"), Array("-l"))
shl.Run(-1)
Wait For shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log(StdOut)
Return StdOut.Contains(ProgramName)
End Sub