I am running four instances of ABBYY (an OCR program), managed by an AutoIT script. When I see that a specific instance is finished, I need to give it focus to send key strokes to shut it down and start over. All of the functions I can find for that want to address the program by-title. But ABBYY will not accept a change in title (WinSetTitle sets the title, then at the next step ABBYY reverts to the standard title). So I can launch and record PID or Handle, but I cannot find how to give focus using either of them. Not preferred, but would try just killing the program, but again, no success using PID or Handle to specify which session to kill.
This is a sample which will launch the program, but will not close it down.
For $i = 1 to 1
$PID[$i] = RunWait("C:\Program Files (x86)\ABBYY FineReader 10\FineReader.exe")