Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Window to top  RSS feed

Chris Hurst
Ranch Hand
Posts: 443
C++ Eclipse IDE 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 :-( )
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!