hi I would like to write a program thta will launch another non-java program and then get a handle on that program so my program can push buttons on the second program is this possible in JAVA where do i start what java package supports this/ thanx Fred
Sean Casey
Ranch Hand
Joined: Dec 16, 2000
Posts: 625
posted
0
This might be possible with some native calls. I'm not sure though. You might want to look at some information on the Java Native Interface (I think that's what it's called).
Fred Abbot
Ranch Hand
Joined: Jun 01, 2000
Posts: 300
posted
0
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
I don't know. Once you lauch the second program, when IT has focus your program is out of control. What is it that you REALLY want to accomplish. Perhaps some more detail.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Fred Abbot
Ranch Hand
Joined: Jun 01, 2000
Posts: 300
posted
0
what i am trying to do is automate a program that my company uses we have a program that once started up we push a series of buttons to get desired results.... we then take those results and write them to a file and do the same process again . . someone actually does this the whole day so I would like to write a program so that i can control the buttons Thank You Fred
Suraj K
Greenhorn
Joined: Jul 02, 2001
Posts: 7
posted
0
if you want to launch a non-java app from windows use this: Runtime().getRuntime().exec("non-java.exe"); thats all.. but i think u will need to enclose it in an exception handler. hope that helped.
Kaspar Dahlqvist
Ranch Hand
Joined: Jun 18, 2001
Posts: 128
posted
0
Hi! The exec() method in Runtime returns a Process object, which can be used to perform IO on it. I think it should be possible to control the subprocess with the methods of this object. But I don't know how...
Chris Camisa
Greenhorn
Joined: Jun 20, 2001
Posts: 4
posted
0
I would like to know how to do this as well... I have wanted to control finding files on peer to peer networks like Napster and GNUtella (Limewire) for a long time. I don't particularly like their interface and I want to change it...
If I could write code that allowed me to read textfields from within those programs and then have it push buttons for me and or fill in textfields then I could write a sorting method to act as AI for my connection to the network. BTW, wouldn't Java need to open the program's window originally so that it didn't catch a security violation of somesort...? --==]Chris Camisa[==--
Fred Abbot
Ranch Hand
Joined: Jun 01, 2000
Posts: 300
posted
0
Thank you all for your help -
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
There is a Robot class (that I have not played with) that might offer some opportunity for setting up scripts for "keystrokes" to help you.
Zkr Ryz
Ranch Hand
Joined: Jan 04, 2001
Posts: 187
posted
0
Im trying this code on my Windows "powered" pc and nothig happens
What else should I do ?
Fred Abbot
Ranch Hand
Joined: Jun 01, 2000
Posts: 300
posted
0
I tried your code - take out the word start - and it works fine
Fred Abbot
Ranch Hand
Joined: Jun 01, 2000
Posts: 300
posted
0
Originally posted by Cindy Glass: There is a Robot class (that I have not played with) that might offer some opportunity for setting up scripts for "keystrokes" to help you.
where can i find this robot class - what package is it in? thanx
This prog launches notepad public class RuntimeDemo { public static void main(String[] args) { Runtime r= Runtime.getRuntime(); Process p = null; try { p = r.exec("notepad"); } catch (Exception ex) { } } }