I added these
Code:
Else If aRect = 4
{
MouseGetPos, x1, y1
Sleep, 5000
MouseGetPos, x2, y2
nL := x1
nT := y1
nW := x2 - x1
nH := y2 - y1
}
Else If aRect = 5
{
MySelectRect(x1, y1, x2, y2)
nL := x1
nT := y1
nW := x2 - x1
nH := y2 - y1
}
Else If aRect = 6
{
MySelectRect2(x1, y1, x2, y2)
nL := x1
nT := y1
nW := x2 - x1
nH := y2 - y1
}
Code:
MySelectRect(ByRef x1, ByRef y1, ByRef x2, ByRef y2)
{
KeyWait, LButton, D
MouseGetPos, x1, y1
Sleep, 1000
Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
WinSet, Transparent, 150
Gui, Color, yellow
While, !(GetKeyState("LButton", "p"))
{
MouseGetPos, x2, y2
w := abs(x1 - x2)
h := abs(y1 - y2)
If ( x1 < x2 )
X := x1
Else
X := x2
If ( y1 < y2 )
Y := y1
Else
Y := y2
Gui, Show, x%X% y%Y% w%w% h%h%
Sleep, 10
}
MouseGetPos, x2, y2
Gui, Destroy
If ( x1 > x2 )
{
temp := x1
x1 := x2
x2 := temp
}
If ( y1 > y2 )
{
temp := y1
y1 := y2
y2 := temp
}
Area = %x1%, %y1%, %x2%, %y2%
Sleep, 100
return
}
MySelectRect2(ByRef x1, ByRef y1, ByRef x2, ByRef y2)
{
KeyWait, LButton, D
MouseGetPos, x1, y1
Gui, +AlwaysOnTop -caption +Border +ToolWindow +LastFound
WinSet, Transparent, 80
Gui, Color, lime
While, (GetKeyState("LButton", "p"))
{
MouseGetPos, x2, y2
w := abs(x1 - x2)
h := abs(y1 - y2)
If ( x1 < x2 )
X := x1
Else
X := x2
If ( y1 < y2 )
Y := y1
Else
Y := y2
Gui, Show, x%X% y%Y% w%w% h%h%
Sleep, 10
}
MouseGetPos, x2, y2
Gui, Destroy
If ( x1 > x2 )
{
temp := x1
x1 := x2
x2 := temp
}
If ( y1 > y2 )
{
temp := y1
y1 := y2
y2 := temp
}
Area = %x1%, %y1%, %x2%, %y2%
Sleep, 100
return
}
MySelectRect: Click once and hover to make a selection
MySelectRect2: Press and hold Left mouse button to make a selection