windows API

P

patrick

I want to do 2 things from within a java application:

1) find out which window on the desktop is top of z-order
2) find out the screen location of a window on the desktop

Cant be done via java only i think.

Im trying to figure out what I need to learn about to do this:

a) Windows API: need code to do the above
b) do I need a C program ? or
c) JNI ? can windows API be accessed via JNI directly
d) or maybe there is another easier solution


TIA

patrick
 
B

Bjorn A

I want to do 2 things from within a java application:

1) find out which window on the desktop is top of z-order
2) find out the screen location of a window on the desktop

I haven't seen any answer to this on my newsserver, so I'll give a shot at
possibly helping you into the right direction.
a) Windows API: need code to do the above

This question you possibly can get better help for in another newsgroup
AFAIK, since it doesn't really involve Java...

One resource for how to create such DLL:s you can find at
http://msdn.microsoft.com/
b) do I need a C program ? or
c) JNI ? can windows API be accessed via JNI directly

JNI is C-based, so you'll have to write the JNI in C or C++. The procedure
is to create a Java-class with "native" methods, and then generate C-headers
from it. Finally you write the rest of the dll...

http://java.sun.com/j2se/1.4.2/docs/guide/jni/

And yes, that's what JNI is all about. To get access to OS-specific
components, you write OS-specific JNI.

// Bjorn A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top