Shmulik
Shmulik

Reputation: 1

Send keystrokes to Java applicaiton in Windows

I'm running a java application from within a C# application. My goal is to fill a couple of input boxes inside the java app automatically using the C# code.

I assume the java application uses Swing for its UI. I've tried using SendMessage and WM_KEYDOWN but nothing happens. Since it's a swing app, the input doesn't have a handle, so I'm using the handle of the entire window.

Any idea how this can be done?

Thanks!

Upvotes: 0

Views: 502

Answers (1)

ckg
ckg

Reputation: 204

Try sending WM_CHAR with a character to see if that works.

If it doesn't you could use Spy++ to see what messages are being sent.

Upvotes: 2

Related Questions