'### Constante de l'opacité (à adapter) ###
'### Pourcentage de l'opacité (0 à 100) ###
Const OPACITE = 30
'##########################################
'--- APIs ---
Declare Function FindWindowA& Lib "user32" ( _
ByVal lpClassName As String, ByVal lpWindowName As String)
Declare Function SetLayeredWindowAttributes& Lib "user32.dll" ( _
ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long)
Declare Function SetWindowLong& Lib "user32.dll" Alias "SetWindowLongA" ( _
ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
'--- Constantes ---
Const WS_EX_LAYERED As Long = &H80000
Const LWA_ALPHA As Long = &H2
Const GWL_EXSTYLE As Long = -20
Sub SetTransparency(Hndl As Long)
SetWindowLong Hndl, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Hndl, 0, 255 * OPACITE / 100, LWA_ALPHA
End Sub