VB Code:
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 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 WS_EX_LAYERED = &H80000
Private Const GWL_EXSTYLE = (-20)
Private Const LWA_COLORKEY = &H1
Private Sub Form_Load()
Dim nStyle As Long
nStyle = GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, nStyle)
Call SetLayeredWindowAttributes(Me.hWnd, vbBlue, 0, LWA_COLORKEY)
End Sub