Detecting other open windows and their location

Discussion in 'Java' started by Sean Knapp, Jun 24, 2006.

  1. Sean  Knapp

    Sean Knapp Guest

    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
     
    Sean Knapp, Jun 24, 2006
    #1
    1. Advertising

  2. "Sean Knapp" <> wrote in message
    news:...
    > 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 http://www.iviz.com/
     
    Matt Humphrey, Jun 24, 2006
    #2
    1. Advertising

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

    "Matt Humphrey" <> wrote in message
    news:...
    >
    > "Sean Knapp" <> wrote in message
    > news:...
    >> 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 http://www.iviz.com/
    >
    >
    >
     
    Kurt M Peters, Jun 24, 2006
    #3
  4. Sean  Knapp

    Sean Knapp Guest

    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

    Kurt M Peters wrote:
    > Can't you just do a getBounds on the frame of interest to find out how big
    > and where the windows are?
    > Kurt
    >
    > "Matt Humphrey" <> wrote in message
    > news:...
    > >
    > > "Sean Knapp" <> wrote in message
    > > news:...
    > >> 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 http://www.iviz.com/
    > >
    > >
    > >
     
    Sean Knapp, Jun 24, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YWJvb21hcjEw?=
    Replies:
    0
    Views:
    326
    =?Utf-8?B?YWJvb21hcjEw?=
    Oct 13, 2004
  2. me
    Replies:
    17
    Views:
    746
  3. Randy Smith
    Replies:
    1
    Views:
    284
    Karl Seguin [MVP]
    Jan 11, 2007
  4. saiho.yuen
    Replies:
    3
    Views:
    457
    kaeli
    Sep 14, 2004
  5. hehehe

    adf java and <location></location>

    hehehe, Jul 6, 2009, in forum: Javascript
    Replies:
    1
    Views:
    116
    Evertjan.
    Jul 6, 2009
Loading...

Share This Page