Keep Any Window on Top Using AHK - Very Simple

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Keep Any Window on Top Using AHK - Very Simple

Post by Dustydog »

[This has been useful enough to me that I'm posting in this section. If an admin feels it's better off in "Other Software" feel free to move it. I like it because it's so simple and transparent - as well as consistently useful while using XY.]

I find myself frequently wanting to keep a window pinned on top of either XY or my program editor - XY help, the forum, something from the net, a command prompt - whatever. In the past, I've tried a variety of keep-that-window-on-top utilities, but this solution for AHK works great. I think many of you already have the AHK program installed (if you don't, perhaps you should :wink: ).

If you're wanting to pin an elevated anything you'll need to run it with elevated privileges. One can, ofc, run it elevated straight from the .ahk file with a right click. Having it load automatically at Windows start, elevated, is beyond the scope here, but it's easily googled. (If anyone wants a compiled version so they don't have to install AHK, PM me. Only the code below will be included in the executable.)

One thing I like about this over all other such utilities is it's utterly simple and transparent, therefore entirely safe to run elevated.

Code: Select all

^SPACE::  
  SoundBeep
  Winset, Alwaysontop, , A
That's it. Simples. Just make sure it's running, select the window you want pinned, push Ctrl-Space, and it will make a small beep and stay pinned on top of all other windows until you push Ctrl-Space again with that same window selected.

[Note: I reinvented this, such as it is. When I discovered someone else's, I changed my shortcut to theirs as I liked Ctrl-Space. I've been using it quite awhile and finally decided to post it here.]

Post Reply