Window Always on Top toggle - Windows only scripting helper

Here’s a little utility for when you’re short on screenspace that allows you to select any window in the Windows OS to make it Always on top. Pressing Ctrl+Windows Key+a makes the selected window always appear on top of all other windows. This is a toggle, so the same hotkey turns it off.

This IS NOT a python plugin, and it only works in Windows. I hope the mods don’t mind that I’m putting this in here. I’ve just found it’s an easy way to be able to keep the console window and programming editor of choice always on top. Kinda nice when developing scripts for blender!

This script was written using AutoHotKey which is what the code below is (you need to have autohotkey installed to run this .ahk file). This was found thanks to this post on the autohotkey forum. I’ve also included a downloadable exe file for those who don’t want to install autohotkey.

When running, the script shows up in the Windows systray down by the clock. It’s a green icon with a white “H”. You can right click and exit, just make sure to toggle the window off.

Script and executable download:
edit: I updated the exe file and original script to be available on github. Link updated.

Save this code as a autohotkey script (ie “WindowTop.ahk”) and run with autohotkey installed

#SingleInstance force
#+Ctrl-A: Toggle window always on top
AutoHotKey(Windows Only) needs to be installed for this to work.
Save this text file as WindowTop.ahk, run script

WinGet, currentWindow, ID, A
WinGet, ExStyle, ExStyle, ahk_id %currentWindow%
if (ExStyle & 0x8)  ; 0x8 is WS_EX_TOPMOST.
   Winset, AlwaysOnTop, off, ahk_id %currentWindow%
   SplashImage,, x0 y0 b fs12, OFF always on top.
   Sleep, 1500
   SplashImage, Off
   WinSet, AlwaysOnTop, on, ahk_id %currentWindow%
   SplashImage,,x0 y0 b fs12, ON always on top.
   Sleep, 1500
   SplashImage, Off

SplashImage, off
SetTimer, TurnOffSI, 1000, Off

For the linux and mac folks, there’s a autohotkey branch of AHK that might work (but not tested):

I find it super useful, maybe someone else will too!

thanks , it super useful to me!

we should have an icon on blender that lock floating windows on top

My pure coincidence I just made a script doing the same thing. But I use Capslock+space

I never use capslock so I disable to and made it another “modifier” key like space or ctrl.

wait you did a script to make floating windows inside of blender ? :eyes:
or its also with this external program ?

It’s also with this external program.

There is 4t Tray Minimizer Free version that is capable of bunch of window magic including traying, rolling, keeping things on top etc.

can u post the link please?
[edit] okay, turns out t’was not hard to find. still this is the link: