If you mean like waiting for a process to start do it like this:
PHP Code:
Public Function ProcessWait(ByVal ProcName As String) As Boolean
Process.EnterDebugMode()
Dim time As Integer = 50
If ProcName = "" Or ProcName.Contains(".exe") = True Then
Return -1
Exit Function
Else
Do Until Process.GetProcessesByName(ProcName).Length > 0
SLeep(time)
Loop
Return True
Exit Function
End If
End Function
Public Sub SLeep(ByVal Time As Integer)
Dim Start As Date = DateTime.Now()
Do Until DateDiff(DateInterval.Second, Start, Now) > Time / 1000
System.Threading.Thread.Sleep(10)
Loop
End Sub
'#################################
'Your code would be like this
'#################################
Dim ProcName As String = String.Empty
ProcName = "calc"
Do Until ProcessWait(ProcName) = True
Sleep(50)
Loop
MsgBox("Process: " & ProcName & ".exe found!")
.....