Set Processes = GetObject("winmgmts:").InstancesOf("Win32_Process")
WScript.Sleep 7000
For Each Process In Processes
If StrComp(Process.Name, "omonitor.exe", vbTextCompare) = 0 Then
' Activate the window using its process ID...
With CreateObject("WScript.Shell")
.AppActivate Process.ProcessId
.SendKeys "123456789{ENTER}"
End With
' We found our process. No more iteration required...
Exit For
End If
Next