cs_bultez
Messages postés13615Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 2013
-
29 sept. 2007 à 15:25
cs_bultez
Messages postés13615Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 2013
-
29 sept. 2007 à 16:56
Bonjour à toutes et à tous,
je ne parviens pas à récupérer la transparence de la fenêtre en cours.
( la mettre, ça baigne, la relire non )
j'ai beau (justement) me relire, relire la doc... je ne vois pas mon erreur.
ce doit être une boulette tellement énorme ( je vais avoir honte ) ...
Option Explicit
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
Private Declare Function GetLayeredWindowAttributes _
Lib "user32.dll" _
(ByVal hwnd As Long, _
ByVal crKey As Long, _
ByVal bAlpha As Byte, _
ByVal dwFlags As Long) As Long
Private Declare Function SetWindowLong _
Lib "user32.dll" Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Const WS_EX_LAYERED As Long = &H80000
Private Const LWA_ALPHA As Long = &H2
Private Const GWL_EXSTYLE As Long = -20
Private Sub Command1_Click()
Dim t1 As Byte
GetLayeredWindowAttributes Me.hwnd, 0, t1, LWA_ALPHA
MsgBox t1 ' affiche toujours 0
End Sub
Private Sub Form_Load()
Dim trans As Integer
trans = 50
SetWindowLong Me.hwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes Me.hwnd, 0, (255 * trans) / 100, LWA_ALPHA
End Sub
c'est, bien sûr, une version simplifiée de mon appli.
si vous pouviez me dépanner, ce serait gentil.
merci d'avance.
Oui, c'est un peu évident.
Ta déclaration de l'api est fausse.
Certains arguments sont passé par références.
Private Declare Function GetLayeredWindowAttributes _
Lib "user32.dll" _
(ByVal hwnd As Long, _
ByRef crKey As Long, _
ByRef bAlpha As Byte, _
ByVal dwFlags As Long) As Long