hellferret
Programmer
Here it is:
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 crey As Byte, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const WS_EX_TRANSPARENT = &H20&
Private Const LWA_ALPHA = &H2&
Option Explicit
Private Sub Form_Load()
Dim lOldStyle As Long
Dim bTrans As Byte ' The level of transparency (0 - 255)
Dim ct, ct2 As Integer
bTrans = 128
lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, 0, 0, LWA_ALPHA
Me.Visible = True
Me.Refresh
For ct = 0 To 255 Step 2
SetLayeredWindowAttributes Me.hwnd, 0, ct, LWA_ALPHA
Next ct
End Sub
Stick this on your form and watch it fade into view.
Nice.
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 crey As Byte, ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_LAYERED = &H80000
Private Const WS_EX_TRANSPARENT = &H20&
Private Const LWA_ALPHA = &H2&
Option Explicit
Private Sub Form_Load()
Dim lOldStyle As Long
Dim bTrans As Byte ' The level of transparency (0 - 255)
Dim ct, ct2 As Integer
bTrans = 128
lOldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
SetWindowLong Me.hwnd, GWL_EXSTYLE, lOldStyle Or WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, 0, 0, LWA_ALPHA
Me.Visible = True
Me.Refresh
For ct = 0 To 255 Step 2
SetLayeredWindowAttributes Me.hwnd, 0, ct, LWA_ALPHA
Next ct
End Sub
Stick this on your form and watch it fade into view.
Nice.