' Needed for acquiring the hWnd of the window
_TITLE "Translucent window test" ' Set screen
'''SCREEN 0 ' Same problem in text screen.
' Main loop
Level = 200
LOCATE 1, 1:
PRINT "Press F1/F2 to change opacity:"; Level;
LOCATE 2, 1:
PRINT "Drag to change window size:"; wdth; hght
SetWindowOpacity Myhwnd, Level
y = 3: x = 1
LOCATE 2, 1:
PRINT "Drag to change window size:"; wdth; hght
IF b$
= CHR$(0) + CHR$(59) AND Level
< 255 THEN Level
= Level
+ 1: SetWindowOpacity Myhwnd
, Level
IF b$
= CHR$(0) + CHR$(60) AND Level
> 0 THEN Level
= Level
- 1: SetWindowOpacity Myhwnd
, Level
LOCATE 1, 1:
PRINT "Press F1/F2 to change opacity"; Level;
'====================================================================\
CONST WS_EX_LAYERED
= &H80000 Msg = GetWindowLong(hwnd, G)
Msg
= Msg
OR WS_EX_LAYERED
action = SetWindowLong(hwnd, G, Msg)
action = SetLayeredWindowAttributes(hwnd, 0, Level, LWA_ALPHA)