1 pièce(s) jointe(s)
Maximize Minimize Close Button dans MDIForm
Bonjour Forum
Bonjour tout le monde
SVP si vous pouvez m'aider a corriger ce code que je l'ai utilise pour supprimer les options Minimize Maximize et Close dans MDIForm ..
J'ai mis ce code .. je l'ai trouve au Net dans ma MDIForm :
Code:
1 2 3 4 5 6 7
| Sub MDIForm_Load()
Dim lWnd As Long
lWnd = GetWindowLong(Me.hwnd, GWL_STYLE)
lWnd = lWnd And Not (WS_MINIMIZEBOX)
lWnd = lWnd And Not (WS_MAXIMIZEBOX)
lWnd = SetWindowLong(Me.hwnd, GWL_STYLE, lWnd)
End Sub |
Et ensuite ce code dans un module simple :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| #If Win32 Then
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
#Else
Declare Function SetWindowLong Lib "User" (ByVal hwnd _
As Integer, ByVal nIndex As Integer, ByVal _
dwNewLong As Long) As Long
Declare Function GetWindowLong Lib "User" (ByVal hwnd _
As Integer, ByVal nIndex As Integer) As Long
#End If
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const GWL_STYLE = (-16) |
Voila la ligne d'erreur ..
Merci beaucoup d'avance pour l'aide
MADA