Option Explicit
Private Const LWA_ALPHA As Long = &H2&
Private Const GWL_EXSTYLE As Long = -20&
Private Const WS_EX_LAYERED As Long = &H80000
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 crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Sub SetOpacity(ByVal NewOpacity As Long)
SetWindowLong hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes hWnd, 0, NewOpacity, LWA_ALPHA
DoEvents
End Sub
Private Sub Form_Activate()
Dim Flag As Boolean, I&
If Flag Then Exit Sub
Me.Left = Screen.Width - Me.Width
Me.Top = Screen.Height - Me.Height
For I = 0 To 255
SetOpacity I
Next
Flag = True
End Sub
Сейчас этот форум просматривают: AhrefsBot и гости: 147