怎么使界面象瑞星启动那样的

来源:百度知道 编辑:UC知道 时间:2024/05/28 02:35:09

我用VB的,把下面代码复制到form1(作为启动窗体),添加一个计时器,时间自己调,创建FORM2作为主窗体

Private Declare Function SetLayeredWindowAttributes Lib \"user32\" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Const WS_EX_LAYERED = &H80000
Const GWL_EXSTYLE = (-20)
Const LWA_ALPHA = &H2
Const LWA_COLORKEY = &H1
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 Sub Timer1_Timer()
Static i
Dim sty As Long
sty = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
sty = sty Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, sty
SetLayeredWindowAttributes Me.hwnd, Abs(i), 150, LWA_