这是一个半透明窗体的代码解释下这个代码吧!
格式:Msgbox" 小伊伊" ' 弹出提示窗口
----------------------------------------------------
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, _
ByVal dwFlags As Long) _
As Long
Private Sub Form_Load()
Dim p As Long
p = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, p Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(Me.hwnd, 0, 127, LWA_ALPHA)
End Sub