FEUILLE TRANSPARENTE

Nox - 29 oct. 2001 à 14:13
Sinsitrus Messages postés 849 Date d'inscription samedi 11 juin 2005 Statut Membre Dernière intervention 21 août 2015 - 8 juil. 2010 à 14:32
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/2040-feuille-transparente

Sinsitrus Messages postés 849 Date d'inscription samedi 11 juin 2005 Statut Membre Dernière intervention 21 août 2015
8 juil. 2010 à 14:32
Merci mimiZanzan pour ton code, il fonctionne à la perfection ^^
Galactus13 Messages postés 335 Date d'inscription lundi 29 septembre 2008 Statut Membre Dernière intervention 16 août 2023 1
26 nov. 2009 à 16:45
tout il est beau ici !
mimiZanzan Messages postés 301 Date d'inscription lundi 27 février 2006 Statut Membre Dernière intervention 17 décembre 2017
16 mars 2009 à 20:18
Je ne sais pas si c'est toujours d'actualité, mais il y existe un code extrêmement simple pour arriver à une form transparente en VB6, et qui marche à tous les coups.
Dans une form, ajouter un bouton Command1 de caption "Exit" par ex et copier ce code:

'Déclarations constantes API
Const LWA_COLORKEY = &H1
Const LWA_ALPHA = &H2
Const GWL_EXSTYLE = (-20)
Const WS_EX_LAYERED = &H80000
'Fonctions API
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" (ByVal _
hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags _
As Long) As Long
'
Private Sub Command1_Click()
Unload Me
End Sub
'
Private Sub Form_Load()
Me.BackColor = RGB(255, 0, 255)
Dim Ret As Long
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me.hWnd, Me.BackColor, 0, LWA_COLORKEY
End Sub

Private Sub Form_Resize()
Command1.Left = (Me.Width - Command1.Width) / 2
Command1.Top = Me.ScaleHeight - Command1.Height - 50
End Sub

Je ne sais plus en fait où j'ai trouvé ce code ou s'il est de moi...

A toutes fins utiles...
Sinsitrus Messages postés 849 Date d'inscription samedi 11 juin 2005 Statut Membre Dernière intervention 21 août 2015
31 mars 2008 à 20:45
3/10 ^^
Sinsitrus Messages postés 849 Date d'inscription samedi 11 juin 2005 Statut Membre Dernière intervention 21 août 2015
31 mars 2008 à 20:45
lol ca marche une fois sur 5 :p
play - stop - play - stop - play - stop - play - stop

Bon ben bah... 3/10 ?
Mhout Messages postés 1 Date d'inscription dimanche 20 mai 2007 Statut Membre Dernière intervention 7 octobre 2007
7 oct. 2007 à 12:12
pas interessant
anegrel Messages postés 12 Date d'inscription vendredi 20 décembre 2002 Statut Membre Dernière intervention 17 janvier 2007
30 déc. 2005 à 14:32
Ce code ne fonctionne effectivement pas. Dommage, cest exactement ce que je recherche, une fenêtre transparente ne laissant apparaître que les controles :(
spycollege Messages postés 50 Date d'inscription mercredi 15 juin 2005 Statut Membre Dernière intervention 8 mars 2007
30 nov. 2005 à 22:51
ca ne marche pas chez moi ?
darkjck Messages postés 17 Date d'inscription dimanche 3 mars 2002 Statut Membre Dernière intervention 15 avril 2004
23 mai 2003 à 16:14
ou java aussi c comme ca
cs_Zeroc00l Messages postés 367 Date d'inscription lundi 1 avril 2002 Statut Membre Dernière intervention 11 février 2010
14 mai 2002 à 23:05
un C++ man ? :)
En visual Basic
lol un débutant
faut pas mettre "//" mais '
Rejoignez-nous