Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Private vgl_Height As Long
Private vgl_Width As Long
Public Sub DisableMaxButton(lhWnd As Long)
Dim hSystemMenu As Long
hSystemMenu = GetSystemMenu(lhWnd, 0)
Call RemoveMenu(hSystemMenu, 4, MF_BYPOSITION)
End Sub
Public Sub DisableMinButton(lhWnd As Long)
Dim hSystemMenu As Long
hSystemMenu = GetSystemMenu(lhWnd, 0)
Call RemoveMenu(hSystemMenu, 3, MF_BYPOSITION)
End Sub
Private Sub MDIForm_Load()
With Me
vgl_Height = .Height
vgl_Width = .Width
DisableMaxButton .hwnd
DisableMinButton .hwnd
End With
End Sub
Private Sub MDIForm_Resize()
With Me
If .WindowState <> 1 Then
.WindowState = 0
.Height = vgl_Height
.Width = vgl_Width
End If
End With
End Sub
'Tasti clikkabili ma non funzionanti