AltSnap
AltSnap copied to clipboard
Always on top - problem with one specific window/program [NinjaTrader]
I have a problem with one specific program (NinjaTrader) when I set a window from NinjaTrader to 'always on top'.
I try to explain the situation with two screenshots - here the first one - I set then the program to the right side to 'always on top'

But see the second screenshot - when I focus chrome (left window) for example the area outside of the main chart (from NinjaTrader window) stays correct always on top. But the footprint chart (the main area from that NinjaTrader window) is not visible anymore.

The outer area from this NinjaTrader window has exactly the same values as the footprint main chart (when I 'inspect' it):

Quite strange indeed. AltSnap simply sets the "root" window to the TOPMOST state, using SetWindowPos. To get the root, it uses GetAncestor(hwnd, GA_ROOT). once the root window of a program is set topmost, all its child windows should inherit the property. I guess the content window has an ancestor but is not marked as a child, so it is not set topmost, even though, the root window has the attribute. I should make a loop on all windows that are in procession of the root window and apply the topmost attribute on all relevent windows. this would induce potential trouble because if I set the flags in the wrong order it will mess-up the layout of the program itself.
I will investigate this.
Note that the identify window option in AltSnap only shows the properties of the "root" window, so to get more details I suggest you use WinSpy++. I would be indeed interested especially in the Styles of the window that disappears.
Can I help you here with anything? Tried your mentioned WinSpy++ for the outer and inner window but WinSpy can't export the values as text, can it? (the 'Capture' button don't add anything to the clipboard here)
Here are two gif animations with all tabs - do you need any specific line/text?
The 'inner' window (footprint chart)

The 'outer' window (top + right side)

It is a more details than I need already, however there is no difference between your two examples, both correspond to the very same window (handle=0x00470D3A), same rectangle etc. It is probably not your fault, and it means that the drawing window is the same window than the root window and has no parent, so it should correspond to what is set topmost. It means that the drawing in the working window is probably a spetial canvas that ignores the flag. Or maybe it interacts with chromium, do you have the same problem when using the notepad window instead of the chromium window?
yes - it doesn't matter which program is below/behind that window. Same happens also when nothing is behind (only the win10 desktop background image).
Ok, I'm a step further.
NinjaTrader has a built-in 'Always on Top' function (when right clicking the main window > 'Always on Top'). So I compared it again with WinSpy++ and found a difference in the 'Extended Style' tab. Hope this helps?

In theory AltSnap should toggle the same flag. But the program probably does internally more than this. I am not sure it is possible for AltSnap to do it.
@Heart1010 Maybe have a try with this version of AltSnap. It goes up the Owner chain instead of stopping at the first top-level window. This might fix the issue you have.
It works!!! 👍 (tested with the 1.55test27_x64.zip)