How to send keystroke/text to some another application/process
Hi,
does anybody know how to send keystroke or text to another application? The "another" application is not java application but it is for example notepad.
For example if I create two processes:
Process proc1 = Runtime.getRuntime().exec("notepad");
Process proc2 = Runtime.getRuntime().exec("notepad");
And I would like to send some text to some of this processes.
I have tried to use class Robot:
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_A);
The problem is, that this class sends the keystroke only to that window which is on top. I need to choose the particular process which the keystroke or some text receive.
Thanks in advance;)