http://www.vb-helper.com/HowTo/nosize.zip

	Purpose
Let the user minimize, maximize, and restore a form, but not resize it

	Method
Subclass and read the form's Windows messages. Ignore any WM_SYSCOMMAND message with the SC_SIZE command.

    Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As WINDOWPOS) As Long
    Const WM_SYSCOMMAND = &H112
    Const SC_SIZE = &HF000&
    
        ' See if this is a WM_SYSCOMMAND message.
        If msg = WM_SYSCOMMAND Then
            ' This is a WM_SYSCOMMAND message.
            ' If the command is SC_SIZE, ignore it.
            If (wParam And &HFFF0) = SC_SIZE Then Exit Function
        End If
    
        ' Continue normal processing. VERY IMPORTANT!
        NewWindowProc = CallWindowProc( _
            OldWindowProc, hwnd, msg, wParam, _
            lParam)
    End Function

NOTE: Any time you subclass a program like this, you can easily crash the entire Visual Basic integrated development environment (IDE), losing any changes you have made. If you click the IDE's Halt button or select End from the Run menu, the IDE does not clean up the subclassed WindowProc properly and crashes.

To avoid serious inconvenience, save your program every time you run it so you don't lose a lot of work.

Don't use the halt button. Instead close the form normally. If you close it by unloading it or by clicking on the little X button in the upper right corner, Visual Basic cleans up its mess and the IDE will not die.

It takes some practice to figure out how to jump out of a program in the middle without crashing. Use Ctrl-F9 to skip over statements you don't want to execute until you can get the program running again. Then close the form normally.

	Disclaimer
This example program is provided "as is" with no warranty of any kind. It is
intended for demonstration purposes only. In particular, it does no error
handling. You can use the example in any form, but please mention
www.vb-helper.com.
