winAPI java

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
Are you saying that to use winAPI in java and send keystrokes to a application?

I don't know whether it is useful or not but I heard about JWinAPI , Check this out --> http://sourceforge.net/projects/jwinapi/
 
Last edited:

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Are you saying that to use winAPI in java and send keystrokes to a application?

I don't know whether it is useful or not but I heard about JWinAPI , Check this out --> http://sourceforge.net/projects/jwinapi/

I tried it but it isn't too compatible, because you can only start the song with it, because when you start a song, the window title is changed, and then it does not work.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
You could try importing user32.dll using @dll.import or System.loadLibrary to get access to PostMessage and send a WM_KEYDOWN & WM_KEYUP or WM_CHAR message(s). Of course, you still need to find the window handle. The "how" of that depends entirely on the windows of interest (All windows? All visible windows? The frontmost window? Windows for a specific application? Something else?), but will involve loading other Windows API procedures.
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
You can't, using only pure Java.
You can however use the Java Native Interface (JNI), and write a native extension for Java that will allow you to do this. The problem is, you'll have to write it in a native language, Java just doesn't have the option to do it.
And of course, if you use the JNI, the hardcore Java guys will hate you.
 
Top