VB 制作程序运行时的淡入效果!

来源:百度知道 编辑:UC知道 时间:2024/06/14 15:10:03
淡入效果 谢谢
谢谢两位拉 各有优点
zdingyun 的淡入好,却没有淡出 (我先试着做淡出)
小fisher 的,有淡入也有淡出,只是淡入时窗口是黑色的...

Option Explicit
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 GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) _
As Long

Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA As Long = &H2
Private Const WS_EX_LAYERED As Long = &H80000

Private Declare Function SetLayeredWindowAttributes Lib "user32" _
(ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Long, _