Detecting other open windows and their location

S

Sean Knapp

Hi all,

I assume this is possible, but have no idea where to start... what I
need to do is get a list of other windows that are open (i.e. firefox,
eclipse, itunes, etc) and ideally some additional information about
them such as location, window title, etc.

Any advice is very much appreciated.
Thanks,
Sean
 
M

Matt Humphrey

Sean Knapp said:
Hi all,

I assume this is possible, but have no idea where to start... what I
need to do is get a list of other windows that are open (i.e. firefox,
eclipse, itunes, etc) and ideally some additional information about
them such as location, window title, etc.

There's nothing implicit in Java (especially because of platform
independence) for doing this. This leaves you with 2 options: Find where
someone has written a JNI library to Windows for retrieving this information
or study Windows yourself and produce such a library.

One such library may be WinPack
http://www.jniwrapper.com/pages/winpack/overview
but you'll have to see for youself if it's as extensive as you need. It
comes from JNIWrapper http://www.jniwrapper.com/pages/winpack/overview
A Java interface to Windows is likely to be large and complex, so you may
have to do some digging to to find a free version. Try searching on (jni
"windows api")

If you have to do it yourself, you can get away without writing JNI directly
by using xFunction http://www.excelsior-usa.com/xfunction.html or a system
like SWIG http://www.swig.org/Doc1.3/Java.html#n2

Cheers,
Matt Humphrey (e-mail address removed) http://www.iviz.com/
 
K

Kurt M Peters

Can't you just do a getBounds on the frame of interest to find out how big
and where the windows are?
Kurt
 
S

Sean Knapp

Hi Kurt,

Will that work? How do I get access to a frame object of another
program that I don't have control of?

Thanks,
Sean
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top