熟悉VB 的进了啊

来源:百度知道 编辑:UC知道 时间:2024/06/22 08:30:23
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Const WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_ALPHA = &H2
Private 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
Dim Color%, m%

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDC Lib "user32" (B

1,s = MsgBox("结果一", vbExclamation, "测试结果")
中的s没有定义

Private Sub Timer1_Timer()
Dim rtn&
Color = Color + m
If Color <= 0 Then
Form0.Hide
ElseIf Color + m >= 255 Then
rtn = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
rtn = rtn And Not WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, rtn
Timer1.enabled = False
Else
SetLayeredWindowAttributes Me.hwnd, 0, Color, LWA_ALPHA
End If
End Sub

Dim Color% 写成 dim Color as byte 好看一点吧

ni bi wo hai lihai wo mei banfa le