La Web del Programador: Comunidad de Programadores
 
    Pregunta:  61025 - ¿COMO APLICO TRANSPARENCIA A UN FORMULARIO?
Autor:  Rebe Fortín
Hola.. Alguien podria decirme como puedo hacer qe un formulario se haga transparente de poco en poco? Por favorr!! Gracias! =)!

  Respuesta:  Juan
*pega este codigo en el init

IF thisform.ShowWindow = 2 .and. thisform.showInTaskBar = .F.
DECLARE INTEGER SetLayeredWindowAttributes IN win32api;
INTEGER HWND, INTEGER crKey, INTEGER bAlpha, INTEGER dwFlags
DECLARE INTEGER SetWindowLong IN user32.DLL ;
INTEGER hWnd, INTEGER nIndex, INTEGER dwNewLong
DECLARE INTEGER GetWindowLong IN user32.DLL ;
INTEGER hWnd, INTEGER nIndex
****************************
#DEFINE LWA_COLORKEY 1
#DEFINE LWA_ALPHA 2
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 0x00080000
LOCAL lnFlags
lnFlags = GetWindowLong(thisform.HWND, GWL_EXSTYLE) &&Gets the existing flags from the window
*thisform.nFlags = lnFlags
lnFlags = BITOR(lnFlags, WS_EX_LAYERED) &&Appends the Layered flag to the existing ones
SetWindowLong(thisform.HWND, GWL_EXSTYLE, lnFlags) &&Sets the new flags to the window
SetLayeredWindowAttributes(thisform.HWND, 0, 0, LWA_COLORKEY)
WITH Thisform
.AutoCenter = .T.
.BorderStyle= 0
.Caption = ""
.Closable = .F.
.ControlBox = .F.
.TitleBar = 0
.BackColor = 0
ENDWITH
ELSE
MESSAGEBOX("La propiedad showWindow del formulario debe ser 2"+ CHR(13)+ ;
"La propiedad showInTaskBar = .F.")
endif