Private Const GWL_EXSTYLE As Long = (-20) Private Const WS_EX_LAYERED As Long = &H80000 Private Const LWA_ALPHA As Long = &H2 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 Sub SetTransparency(ByVal whWnd As Long, ByVal wAlpha As Byte) Dim Style As Long Dim Ver As Long If (wAlpha = 255) Then Style = GetWindowLong(whWnd, GWL_EXSTYLE) Style = Style And Not WS_EX_LAYERED SetWindowLong whWnd, GWL_EXSTYLE, Style Else Style = GetWindowLong(whWnd, GWL_EXSTYLE) Style = Style Or WS_EX_LAYERED SetWindowLong whWnd, GWL_EXSTYLE, Style SetLayeredWindowAttributes whWnd, 0, wAlpha, LWA_ALPHA End If End Sub ' ==== Utilisation : ' SetTransparency(me.hwnd,128) '
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.