I have the following script that highlights the active window (I will use notepad class for the example):
Code: Select all
SetTimer, DrawRect, 50
border_thickness = 20
border_color = FFFF00
GroupAdd, XXX, ahk_class Notepad
DrawRect:
MouseGetPos,,, mousehwnd
if (mousehwnd = WinExist("A")) {
Gui, Destroy
return
}
ifwinactive ahk_group XXX
{
WinGetPos, x, y, w, h, A
Gui, +Lastfound +Toolwindow
iw:= w + 24
ih:= h + 24
w:= w + 42
h:= h + 42
x:= x - 2 - border_thickness
y:= y - 2 - 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
Return
}
What I'm trying to do is this:
1. Gui hidden when I have the mouse over the active window, and gui definitely destroyed when any command is sent (from keyboard, mouse, Send etc.) to the active window
2. Possibility of multiple gui, which are not destroyed until any command is sent to the specific window, then if software first activate window A, then B, then C the gui remains active on for each window and each window's gui waits for my command.
I thought about eliminating "SetTimer" and introducing "Goto" and "winwaitnotactive" %windowID%"
Should I use some ddlcall function?
I have done several tests without results, can you give me a hand?