I would like to write an application who creates input for a non-Java application in Windows. With the Robot class it’s easy to generate the input, but I need to set the focus to another application’s text box and enter the text over there.
Don’t worry I’m not trying to write something malicious, I just want to use Java to “extend” an old application written in Delphi.
CMDOW is a command line utility which allows you to perform various window actions such as activating/deactivating, listing, minimising/maximising etc.
Alternatively, you can write a VBScript to activate another application. For example:
Then use
Runtime.execfrom your Java app to execute the script.This will help you activate another application.
However, it will be much more difficult if you want to focus on a textbox within the other application and write some text.