Is there a way to make a toggle button for always on top?

I’m very interested in creating a button on the title bar for all windows, that will allow it to change it’s position to “always on top”. But it would just be for the window that the button was activated on, not the class of program.

I can’t find anything even closely related on or through the very limited search bar on this site. Is this possible? And if so, how?

Yes, Just use the StaysOnTop/StaysPut Style (or define your own Layers).

For a toggle, you will need to test what layer you are on to determine what style to apply. And if you use WindowStyle, it will only apply to the current window, not a class/resource/name. Something like this should work as a toggle function. Call it from a normal binding.

DestroyFunc ToggleStaysOnTop
AddToFunc ToggleStaysOnTop
+ I ThisWindow ( Layer 6 ) WindowStyle StaysPut
+ I TestRc (NoMatch) WindowStyle StaysOnTop

Thank you! I was looking for this! It’s nice to have such a helpful forum. :slight_smile: