Attribute VB_Name = "ModTransparent"
Option Explicit

'FORM ENTER FADE
Public Const LWA_ALPHA = 2
Public Const LWA_COLORKEY = 1
Public Const LWA_BOTH = 3
Public Const GWL_EXSTYLE = -20
Public Const WS_EX_LAYERED = &H80000
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal color As Long, ByVal X As Byte, ByVal alpha As Long) As Boolean

'FORM ENTER FADE
Public Sub ofFrm(hwnd As Long, Transval As Integer)
    Dim gt As Long
    gt = GetWindowLong(hwnd, GWL_EXSTYLE)
    SetWindowLong hwnd, GWL_EXSTYLE, gt Or WS_EX_LAYERED
    SetLayeredWindowAttributes hwnd, RGB(255, 255, 0), Transval, LWA_ALPHA
    Exit Sub
End Sub



