(VFP) - Display Fade in Form How to Do it ?

******************************************
** Examples How to Display Fade In Form **
******************************************
_screen.WindowState = 2

LOCAL frmFadeIn as Form
frmFadeIn = CREATEOBJECT("myFadeInForm")
frmFadeIn.Show
READ EVENTS

DEFINE CLASS myFadeInForm as Form
AutoCenter = .T.
Caption = "Fade-In Form"
ShowWindow = 2
nDepth = 0

ADD OBJECT fadeTime as timer WITH ;
interval = 10,;
enabled = .T.

PROCEDURE Init
DECLARE INTEGER SetWindowLong IN user32.DLL INTEGER hWnd, ;
INTEGER nIndex, ;
INTEGER dwNewLong
DECLARE INTEGER SetLayeredWindowAttributes IN WIN32API INTEGER HWND, ;
INTEGER crKey, ;
INTEGER bAlpha,;
INTEGER dwFlags

#DEFINE LWA_TRANSPARENT 1
#DEFINE LWA_ALPHA 2
#DEFINE GWL_EXSTYLE -20
#DEFINE WS_EX_LAYERED 0x00080000

SetWindowLong(thisform.HWND, GWL_EXSTYLE, WS_EX_LAYERED)
SetLayeredWindowAttributes(thisform.HWND, 0, thisform.nDepth, LWA_ALPHA)
ENDPROC

PROCEDURE unload
CLEAR DLLS
CLOSE ALL
RELEASE ALL
QUIT
ENDPROC

PROCEDURE fadeTime.timer
IF thisform.nDepth <= 255
SetLayeredWindowAttributes(thisform.HWND, 0, thisform.nDepth, 2)
thisform.nDepth = thisform.nDepth + 1
ELSE
this.Enabled = .F.
ENDIF
ENDPROC
ENDDEFINE

Comments

Popular posts from this blog

(VFP) - Running Visual FoxPro on Linux

(VFP) - How To Run Exe File and include them to your Project

(VFP) - How to put calendar on your vfp application