• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Window to top

Ranch Hand
Posts: 443
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a Windows/Java/Swing app that can jump to being top window at the click of a button even when not focused\activated\foreground , iconfied etc in Windows e.g. you hit a special big red button and my applet kicks in regardless of what else your doing.

I've JNI'ed a hook which works fine to get all keyboard events (everything works 100% key event wise) but currently my only way to get the target window to be top window all time time is if I iconfiy / zoom i.e.

This again works for everything but I was hoping to do a more move to front type functionality, if the window is already on screen but perhaps obscured (or partially obscured) move it to the top and do nothing if it is top.

I tried stuff like this but if the window is obscured by another (non swing window) it stays that way (unlike my first attempt above)

(I don't do that much Swing so be gentle)

If this is just not possible, is there a way I can detect that the Window is not obscured i.e. Foreground (that way I can turn off the zoom when not needed :-) ) other than using JNI (which at the moment I'll end up doing :-( )
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!