Use Rhino's link.
(Just as I've already written this code for you, I'm posting it here.
)
Disable MDI Form Resize:
VB Code:
' Inside MDI Form
Option Explicit
'================================================================
Private Sub MDIForm_Load()
' Subclass the form
pOldWindPoc = SetWindowLong(Me.hwnd, GWL_WNDPROC, AddressOf WndProc)
End Sub
'==================================================================
Private Sub MDIForm_Unload(Cancel As Integer)
' Un-subclass the form
SetWindowLong Me.hwnd, GWL_WNDPROC, pOldWindPoc
End Sub
VB Code:
'Inside a Module
Option Explicit
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" _
(ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal msg As Long, _
ByVal wParam As Long, _
lParam As WINDOWPOS) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Type WINDOWPOS
hwnd As Long
hWndInsertAfter As Long
x As Long
y As Long
cx As Long
cy As Long
flags As Long
End Type
Public pOldWindPoc As Long ' A pointer to the old window procedure
Public Const GWL_WNDPROC& = (-4)
Private Const WM_WINDOWPOSCHANGING As Long = &H46
Private Const SWP_NOSIZE As Long = &H1
'================================================================
' Our new window procedure
Public Function WndProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal wParam As Long, _
lParam As WINDOWPOS) As Long
If uMsg = WM_WINDOWPOSCHANGING Then
' Ignore sizing
lParam.flags = lParam.flags Or SWP_NOSIZE
End If
' Pass the message to original WinProc
WndProc = CallWindowProc(pOldWindPoc, hwnd, uMsg, wParam, lParam)
End Function