ciao, come si fa ad impedire ad un mdiform di ridimensionarsi o di massimizzarsi/minimizzarsi?
ciao, come si fa ad impedire ad un mdiform di ridimensionarsi o di massimizzarsi/minimizzarsi?
perla
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
Const WS_THICKFRAME = &H40000
Const WS_MINIMIZEBOX = &H20000
Const WS_MAXIMIZEBOX = &H10000
Const WS_SYSMENU = &H80000
Const GWL_STYLE = (-16)
Private Sub MDIForm_Load()
SetWindowLong Me.hwnd, GWL_STYLE, GetWindowLong(Me.hwnd, _
GWL_STYLE) And Not (WS_SYSMENU Or WS_THICKFRAME Or WS_MINIMIZEBOX Or WS_MAXIMIZEBOX)
End Sub
L'unica cosa e che i tasti(compreso quello di chiusura) non vengono disabilitati ma tolti
La passera non dura perchè Sypher la cattura!
"No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"
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
La passera non dura perchè Sypher la cattura!
"No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000
Private Const GWL_STYLE = (-16)
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
Private Sub MDIForm_Load()
Dim L As Long
L = GetWindowLong(Me.hwnd, GWL_STYLE)
L = L And Not (WS_MINIMIZEBOX)
L = L And Not (WS_MAXIMIZEBOX)
L = SetWindowLong(Me.hwnd, GWL_STYLE, L)
End Sub
'Rimane solo il tasto di chiusura secondo me è il migliore
Non so darti altre informazioni al riguardo![]()
La passera non dura perchè Sypher la cattura!
"No one like us we don't care, we are millwall, super millwall, we are millwall from the DEN"