I'm trying to modify my script so that the frame of each window that popups in active remains drawn to my mouse click.
Example:
Window A is brought to the foreground, after 5 seconds Window B in foreground, after 3 seconds Window C in foreground -> I will have 3 windows all with the border frame, and each border will only be destroyed after clicking on that specific window.
Help me?
Code: Select all
SetTimer, DrawRect, 50
border_thickness = 30
border_color = FFFF00
return
DrawRect:
IfWinNotActive, ahk_class QWidget,, Welcome
IfWinNotActive, ahk_class Qt5QWindowIcon,, Snai
{
gui, hide
return
}
MouseGetPos,,, mousehwnd
if (mousehwnd = WinExist("A")) {
Gui, Destroy
return
}
WinGetPos, x, y, w, h, A
Gui, +Lastfound +AlwaysOnTop +Toolwindow
iw:= w+30
ih:= h + 30
w:=w+ 58
h:=h + 58
x:= x - border_thickness
y:= y - border_thickness
Gui, Color, FFFF00
Gui, -Caption
WinSet, Region, 0-0 %w%-0 %w%-%h% 0-%h% 0-0 %border_thickness%-%border_thickness% %iw%-%border_thickness% %iw%-%ih% %border_thickness%-%ih% %border_thickness%-%border_thickness%
Gui, Show, w%w% h%h% x%x% y%y% NoActivate, Table awaiting Action
return
LButton::
MouseGetPos,,, mousehwnd
if (mousehwnd = WinExist("A"))
Gui, Destroy
Click, down
KeyWait, LButton
Click, up
Return
MButton::
MouseGetPos,,, MouseWin
WinClose, Ahk_id %MouseWin%
Return