0

I have a topmost window. I need it be the topmost over any other topmost window but not cover any fullscreen window: particularly: {Windows Media Player, Youtube flash player, RDP}

There is a solution with continuous checks:

  • every YYY milliseconds I check is there(on the same display) another topmost window with dimensions equal to screen dimensions.
  • if so: make my window non-topmost, otherwise make it topmost.

But I’m looking for another less resource-consuming solution which will not perform dozens of system calls and traverse the entire tree of topmost windows every second.

I can handle any WM_

I can inject hook into a process.

The problem:

How to detect a full screen window on the same desktop?

How to detect fullscreen mode using incoming WM_(s) or any technique other than continuous checking?

  • 3
    "I need it be the topmost over any other topmost window..." Imagine if two programs did this. http://blogs.msdn.com/b/oldnewthing/archive/2011/03/10/10138969.aspx – jamesdlin Mar 05 '13 at 03:06
  • topmost -- is not the problem; The problem: how to detect full screen window(s), particularly Youtube flash player which is not a topmost window but toolwindow. – Andrei Anufreiv Mar 05 '13 at 17:49
  • I know that (which is why it's a comment and not an answer). I'm just saying that having a goal of trying to be the topmost window over all other topmost windows is foolhardy. – jamesdlin Mar 05 '13 at 18:49

1 Answers1

1

Check out SetWindowsHookEx() to set a CBT hook (WH_CBT). In particular, in your CBTProc() you'll get a WHCBT_MOVESIZE notification when a window is being moved or sized.

HerrJoebob
  • 2,264
  • 16
  • 25