here is another solution with transparent or fading dialogs. Maybe it´s helpful or you
#include "Fivewin.ch"
#define LWA_ALPHA 2
#define GWL_EXSTYLE -20
#define WS_EX_LAYERED 524288
FUNCTION MAIN()
LOCAL oDlg, nFactor := 210, btnmais, btnmenos, btnloops
DEFINE DIALOG oDlg;
TITLE "Transparent dialog" pixel from 0, 0 to 400, 400
@10, 10 SAY "This is a test" SIZE 30, 7 pixel
oDlg:bpainted := { || SETTRANSP( oDlg, nFactor ) }
@050, 10 button btnMais prompt "Mais Transparencia" ;
action TRANSPAR( oDlg, @nFactor, "+", btnmais ) size 70, 20 pixel
@050, 100 button btnMenos prompt "Menos Transparencia" ;
action TRANSPAR( oDlg, @nFactor, "-", btnmenos ) size 70, 20 pixel
@100, 50 button btnloops prompt "Alternando Transparencia" ;
action TRANSLOOP( oDlg, @nFactor ) size 70, 20 pixel
ACTIVATE DIALOG oDlg CENTER
RETURN NIL
STATIC FUNCTION SETTRANSP( oDlg, nFactor )
SETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE, ;
NOR( GETWINDOWLONG( oDlg:hWnd, ;
GWL_EXSTYLE ), WS_EX_LAYERED ) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , ;
nFactor, LWA_ALPHA )
RETURN NIL
static function TRANSPAR( oDlg, nFactor, Sinal, oBtn )
if Sinal = "+"
if nFactor < 10 ; nFactor := 260 ; endif
nFactor -= 5
else
if nFactor > 250 ; nFactor := 5 ; endif
nFactor += 5
endif
SetWindowText( oDlg:hWnd, "Transparent dialog. Transparencia: " + alltrim(str(nFactor)) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , nFactor, LWA_ALPHA )
sysrefresh()
return (nil)
static function TRANSLOOP( oDlg, nFactor, Sinal, oBtn )
local X
for X = 1 to 255
SetWindowText( oDlg:hWnd, "Transparent dialog. Transparencia: " + alltrim(str(x)) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , x, LWA_ALPHA )
next
for X = 255 to 1 step -1
SetWindowText( oDlg:hWnd, "Transparent dialog. Transparencia: " + alltrim(str(x)) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , x, LWA_ALPHA )
next
SetWindowText( oDlg:hWnd, "Transparent dialog. Transparencia: " + alltrim(str(nFactor)) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , nFactor, LWA_ALPHA )
sysrefresh()
return NIL
DLL32 function SetLayeredWindowAttributes( hWnd As LONG, crKey As LONG,;
bAlpha As LONG, dwFlags As LONG ) AS LONG PASCAL ;
from "SetLayeredWindowAttributes" lib "user32.DLL"