02-19-2021, 10:29 PM
sorry wasn't at pc when I posted before. This should work as expected.
just need to add a check to see if the window is layered first and if not make it so.
Function Trans_Lower
Trigger #Dh2
just need to add a check to see if the window is layered first and if not make it so.
Function Trans_Lower
Trigger #Dh2

int hwnd=win(mouse)
int col flags z
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
out "alpha %i" alpha
z=15
if alpha=0
,alpha=255
else
,alpha-z
out "alpha %i %i" alpha hwnd
if alpha<15
,Transparent(hwnd 15)
,3
,end
Transparent(hwnd alpha)