Did you know that you can use Robot to control even native windows. Apparently the code finds the top window generated by the application. And so it can be a native application like Microsoft Word document which you have opened using System.exec. And if you open two such applications the events will go to the application window on top.

I wonder if Alt-Tab would allow me to operate on other windows…