Ну, к примеру:
- Код: Выделить всё
Private Sub Form_Resize()
If Me.Width < 100 Then Me.Width = 100
End Sub
Private Sub Form_Resize()
If Me.Width < 100 Then Me.Width = 100
End Sub
Global p&
Public Const WM_GETMINMAXINFO = &H24
Public Const GWL_WNDPROC = (-4)
Public MMInfo As MINMAXINFO
Public Type POINTAPI
x As Long
y As Long
End Type
Public Type MINMAXINFO
ptReserved As POINTAPI
ptMaxSize As POINTAPI
ptMaxPosition As POINTAPI
ptMinTrackSize As POINTAPI
ptMaxTrackSize As POINTAPI
End Type
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public Function Handler&(ByVal h&, ByVal m&, ByVal w&, ByVal l&)
If m = WM_GETMINMAXINFO Then
CopyMemory MMInfo, ByVal l, Len(MMInfo)
With MMInfo
.ptMinTrackSize.x = 500 ' Ieieiaeuiay oe?eia
.ptMinTrackSize.y = 500 ' Ieieiaeuiay aunioa
End With
CopyMemory ByVal l, MMInfo, Len(MMInfo)
Handler = DefWindowProc(h, m, w, l)
Else
Handler = CallWindowProc(p, h, m, w, l)
End If
End Function
Private Sub Form_Load()
p = SetWindowLong(hwnd, GWL_WNDPROC, AddressOf Handler)
End Sub
Сейчас этот форум просматривают: AhrefsBot, Google-бот и гости: 87