Need Help for Robot class even on inactive window
Recently, I've learn a little on how to use Robot class and Multi-threading..
Using what i've learnd, Im developing a program that continuously posting on a chatbox in an ACTIVE window..and I did it well..
until I realize that its better to keep the program running and posting even when the window is inactive so that I can still perform other task on other window...Is there a way how to make it?If you have an idea, i realy need ur help! tnx
Re: Need Help for Robot class even on inactive window
Unfortunately, the Java Robot class only allows you to "simulate" what the user can do, i.e. move/press the mouse somewhere, or press a keyboard. It can't send a direct virtual event to another program. I believe the only way around this is by writing a low-level API in C/C++, then using JNI to interface with it, or alternatively find one that someone else has made.
Re: Need Help for Robot class even on inactive window
thanks sir for the reply..
oh my!sir, do you have an idea where can I find a low level API for that?
and another problem is, I have nothing about JNI..
Re: Need Help for Robot class even on inactive window
I'm not aware of any, likely you'll have to write your own (unfortunately, I'm not sure how you would do this, google should be able to help you, though).
There's a pretty good tutorial (albeit a little old) at JavaWorld about how to use JNI (note: there will be C/C++ programming involved).
Link: Enhance your Java application with Java Native Interface (JNI) - JavaWorld