I adjusted this version so it will go all the way down and when it gets to 0 will set alpha to 255.
Function Trans_Lower_Mod1
Trigger #Dh2
Function Trans_Raise_Mod1
Trigger #Uh2
Function Trans_Lower_Mod1
Trigger #Dh2
int hwnd=win(mouse)
int col flags
byte alpha
int e(GetWindowLong(hwnd GWL_EXSTYLE)) t(e&WS_EX_LAYERED!=0)
if(!t)
,out "not Layered"
,SetWindowLong(hwnd GWL_EXSTYLE e|WS_EX_LAYERED)
,SetLayeredWindowAttributes(hwnd 0 255 2)
GetLayeredWindowAttributes hwnd &col &alpha &flags
alpha-17
out "alpha %i" alpha
if alpha<17
,alpha=255
,Transparent(hwnd -alpha)
else
,Transparent(hwnd alpha)
Function Trans_Raise_Mod1
Trigger #Uh2
int hwnd=win(mouse)
int col flags
byte alpha
int e(GetWindowLong(hwnd GWL_EXSTYLE)) t(e&WS_EX_LAYERED!=0)
if(!t)
,out "not Layered"
,SetWindowLong(hwnd GWL_EXSTYLE e|WS_EX_LAYERED)
,SetLayeredWindowAttributes(hwnd 0 0 2)
GetLayeredWindowAttributes hwnd &col &alpha &flags
alpha+17
if alpha =255
,Transparent(hwnd -alpha)
else
,Transparent(hwnd alpha)
out "alpha %i" alpha