VB Code:
'/ api used to make the form invisible
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.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
'/ constants for transparate form
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
VB Code:
Dim Ret As Long
Dim clr As Long
Dim Ret1 As Long
Dim clr1 As Long
Me.BackColor = vbRed
lstIP.BackColor = vbRed
clr = vbRed ' RGB(255, 0, 0) 'Color for Transparent part of form
Ret = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hwnd, GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me.hwnd, clr, 128, LWA_COLORKEY
SetWindowLong lstIP.hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT