Comment cacher le bouton d'une MdiForm de la barre des taches équivalent &#

teac Messages postés 2 Date d'inscription vendredi 10 janvier 2003 Statut Membre Dernière intervention 14 mars 2003 - 13 mars 2003 à 21:40
cs_didine13 Messages postés 96 Date d'inscription mardi 18 août 2009 Statut Membre Dernière intervention 14 août 2013 - 22 févr. 2011 à 17:50
Bonjour,

j'ai un petit pb je voudrais enlever le bouton d'une MDIform qui se situe dans la barre des taches. En bref pouvoir faire comme pour une form : ShowInTaskbar=False
Est ce que qqun aurait un code???

Merci d'avance ;)

3 réponses

fredlynx Messages postés 662 Date d'inscription mercredi 16 janvier 2002 Statut Modérateur Dernière intervention 16 octobre 2010 3
13 mars 2003 à 23:41
Voili tu ajoute ça dans ta MDi.... ou tu arrange pour mettre dans un module...

ShowInTaskBar False 'Cache

ShowInTaskBar True 'Affiche

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 ShowWindow Lib "user32" _
(ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long

Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_APPWINDOW = &H40000
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5

Private Function ShowInTaskBar(Valeur As Boolean)
Dim OldStyle As Long
Dim NewStyle As Long

OldStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
If Valeur = True Then
NewStyle = OldStyle Or WS_EX_APPWINDOW
Else
NewStyle = OldStyle And (Not WS_EX_APPWINDOW)
End If

If NewStyle = OldStyle Then Exit Function

ShowWindow Me.hwnd, SW_HIDE
SetWindowLong Me.hwnd, GWL_EXSTYLE, NewStyle
ShowWindow Me.hwnd, SW_SHOW
End Function

<center>http://www.fredlynx.com
</center>
0
teac Messages postés 2 Date d'inscription vendredi 10 janvier 2003 Statut Membre Dernière intervention 14 mars 2003
14 mars 2003 à 12:40
Merci beaucoup fredlynx ca fonctionne impec

Encore merci 8-)
0
cs_didine13 Messages postés 96 Date d'inscription mardi 18 août 2009 Statut Membre Dernière intervention 14 août 2013
22 févr. 2011 à 17:50
Bonjour,

Je cherche la même chose, donc juste pour dire merci a fredlynx
0
Rejoignez-nous