Always on Top - Custom Script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
harrydsilva18
Posts: 1
Joined: 30 Jul 2021, 10:36

Always on Top - Custom Script

Post by harrydsilva18 » 30 Jul 2021, 11:39

I am trying to get a script which helps me make all windows stay always on top and clicking middle mouse button on the title bar disables it. I was able to modify the script of CClose made by Chahoe Shi but the problem is the script gets applied only if i middle click on each window. I want all the windows with this script activated and then disable the ones which i don't.

Disclaimer : This script is not owned by me and the owner is Chahoe Shi.
Attachments
CClose.ahk
(15.39 KiB) Downloaded 20 times
Last edited by gregster on 30 Jul 2021, 12:07, edited 2 times in total.
Reason: Topic moved from 'Wish List'.
User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: Always on Top - Custom Script

Post by mikeyww » 30 Jul 2021, 13:48

Code: Select all

WinGet, win, List
Loop, %win% {
 WinGetTitle, wTitle, % winTitle := "ahk_id " win%A_Index%
 WinGet, proc, ProcessName, %winTitle%
 If visible(winTitle) && wTitle > "" && proc != "Explorer.EXE"
  WinSet, AlwaysOnTop, On, %winTitle%
}
SoundBeep, 1500

~MButton::
CoordMode, Mouse
MouseGetPos, xpos, ypos, uid
SendMessage, 0x84,, ypos << 16 | xpos,, ahk_id %uid%
If (ErrorLevel != 2)
 Return
WinSet, AlwaysOnTop, Off, ahk_id %uid%
SoundBeep, 1500
Return

visible(winTitle) {
 WinGet, thisStyle, Style, %winTitle%
 Transform, visible, BitAnd, %thisStyle%, 0x10000000 ; 0x10000000 is WS_VISIBLE.
 Return visible
}
Post Reply

Return to “Ask for Help (v1)”