Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
Public lngresult As Long
Public Const LWA_COLORKEY = 1
Option Explicit
Public Const SWP_NOMOVE = 2
Public Const SWP_NOSIZE = 1
Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Private m_lngRetVal As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowPos Lib "user32" _
(ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal x As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Public Sub maketrans()
lngresult = GetWindowLong(
Form1.hWnd, GWL_EXSTYLE)
lngresult = SetWindowLong(
Form1.hWnd, GWL_EXSTYLE, lngresult Or WS_EX_LAYERED)
SetLayeredWindowAttributes
Form1.hWnd, RGB(
255, 255, 255), 128, LWA_COLORKEY 'Change the 255, 255, 255 for the background color that ur 'using (here white), so white will be transparent (ALL things that have white 'background).
End Sub
Public Sub nomaketrans()
SetWindowLong
Form1.hWnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes
Form1.hWnd,
255, 255, LWA_ALPHA 'Same Here (U can find LWA_ALPHA on top)
End Sub