1. is it possible to send keys to specific programs? like batch files?
2. Here is my command
Private Sub Command11_Click()
Do While xxxxxxxx
SendKeys "R", True
Loop
End Sub

can someone teach me how to fill in the xxxxxxxx?
what i need is to stop sendkeys to the running program have the focus now (an external program opened by other programs like a batch file which is in turn opened by vb6), when a file is created after the external program has finished running. Or stop sendkeys after the batch file which is opened directly by vb6 has closed.