I am trying to make a little Java application that takes input from me, opens another application (Windows Calculator / "calc") and feeds that application with my input.
At the moment, I am trying to do this to the simple Windows Calculator, but it doesn't seem to work with the conventional means:
public Feeder(String processID) throws Exception {
rt = Runtime.getRuntime();
proc = rt.exec("calc");
input = new BufferedWriter(new OutputStreamWriter(proc.getOutputStream()));
}
public void sendCommand(int cmd) throws Exception {
input.write(cmd);
input.flush();
input.close();
proc.waitFor();
}
(Partially taken from another source, credit due to author)
However, contrary to the above code, which sends to another command-line process, WinCalc is graphical. Is it still possible to send input to it without having to go through all sorts of trouble like reverse engineering?