0

I'm writing a HUD style application (just text, zero user interaction) and I want my text / water marks to always be visible regardless of other apps on the system.

I made myself a WPF popup and topmost but if other applications come along that want to be topmost as well they seem to supersede mine.

Is there win32 support to override this and effectively watermark system / appplication wide?

Ternary
  • 2,401
  • 3
  • 31
  • 54

1 Answers1

1

Nope. From Raymond Chen's blog: What if two programs tried to do this?

"How do I create a window that is never covered by any other windows, not even other topmost windows?"

Imagine if this were possible and imagine if two programs did this. Program A creates a window that is "super-topmost" and so does Program B. Now the user drags the two windows so that they overlap. What happens? You've created yourself a logical impossibility. One of those two windows must be above the other, contradicting the imaginary "super-topmost" feature.

Brian Rogers
  • 125,747
  • 31
  • 299
  • 300
  • What if I am in control of all programs. Is it possible for my program to be topmost and to specify the second program be topmost-1 (but still topmost among everyone else)? – Ternary Aug 03 '13 at 20:32
  • Oh and in the case described by Raymond - don't sprite engines (w/ zorder) use time of creation as the tie breaker? – Ternary Aug 03 '13 at 20:33
  • If you were in control of all programs, you wouldn't need a "super-topmost" feature, you could just implement your own protocol between all your programs to negotiate who should be on top. But Windows doesn't know that you own all programs; it is designed for programs from multiple different authors to run simultaneously. – Brian Rogers Aug 04 '13 at 06:54
  • Is there a way (when controlling all programs) to set a specific z-order. So one window could be 1, then 2, then 3, etc. instead of just the binary topmost true/false? – Ternary Aug 09 '13 at 19:46
  • As far as I know, there is not a way to numerically assign a z-order (I could be wrong); however, there are windows APIs that let you bring a window to the top of the order. Given this, one way to do it would be to find all the windows you're interested in, put them into a list in the order of how you want them to appear, then iterate over that list in reverse order, setting set each window, in turn, to the top position. This [question](http://stackoverflow.com/questions/257587/bring-a-window-to-the-front-in-wpf) might help. – Brian Rogers Aug 09 '13 at 21:04