Skip to content

Instantly share code, notes, and snippets.

@NigelThorne
Created March 13, 2014 22:36
Show Gist options
  • Save NigelThorne/9538578 to your computer and use it in GitHub Desktop.
Save NigelThorne/9538578 to your computer and use it in GitHub Desktop.
Highlight the active window
#Persistent
SetTitleMatchMode, 2
SetTitleMatchMode, Fast
SetTimer, DrawRect, 50
border_thickness = 5
Table_String = Table
DrawRect:
WinGetTitle, title, A
WinGetPos, x, y, w, h, A
if x || x = 0
{
Gui, +Lastfound +AlwaysOnTop +Toolwindow
t:= border_thickness
iw:= w ; border_thickness
ih:= h ; border_thickness
ow:= w + ( border_thickness)
oh:= h + ( border_thickness)
ox:= x - (0.5 * border_thickness)
oy:= y - (0.5 * border_thickness)
Gui, Color, FF0000
Gui, -Caption
WinSet, Region, 0-0 %ow%-0 %ow%-%oh% 0-%oh% 0-0 %t%-%t% %iw%-%t% %iw%-%ih% %t%-%ih% %t%-%t%
Gui, Show, w%ow% h%oh% x%ox% y%oy% NoActivate, Table
}
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment