this is the code for tje fading effect of a form..
can anyone explain this code to me.. i really wanna learn this thing..
or
do you have any site or ebooks to read related to my problem??
I dont know what book should I read.
Is this all about WINDOWS API PROGRAMMING?
Dim Alpha
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As LongPrivate Sub Form_Load()
Dim Ret As Long
'Set the window style to 'Layered'
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
Timer1.Interval = 20End Sub
Private Sub Timer1_Timer()
Alpha = Alpha + 1
If Alpha > 255 Then
Timer1.Enabled = False
Exit Sub
End If
'Set the opacity of the layered window
SetLayeredWindowAttributes Me.hWnd, 0, Alpha, LWA_ALPHA
End Sub