"Frame on window active" to "frame on every windows have been active"

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
teosc
Posts: 54
Joined: 17 Jun 2017, 04:56

"Frame on window active" to "frame on every windows have been active"

12 Jul 2017, 17:41

Hi everyone and sorry for my bad english.
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
User avatar
boiler
Posts: 16957
Joined: 21 Dec 2014, 02:44

Re: "Frame on window active" to "frame on every windows have been active"

22 Jul 2017, 06:13

It's not a simple mod to the script you posted because you need to have it create multiple frame GUIs, and you need to associate each with the window it is associated with so that you can recognize which GUI to destroy when its associated window becomes active.

Given that description of how to do it, you could work on changing the script to accomplish that. Since you're asking how it would be done, I'm guessing that implementing it wouldn't be easy for you, but good luck.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mebelantikjaya, NinjoOnline and 287 guests