Naked » 11.10.2005 (Вт) 6:19
пиши в модуле
Type POINTAPI
x As Long
y As Long
End Type
Type MINMAXINFO
ptReserved As POINTAPI
ptMaxSize As POINTAPI
ptMaxPosition As POINTAPI
ptMinTrackSize As POINTAPI
ptMaxTrackSize As POINTAPI
End Type
Public Const WM_GETMINMAXINFO = &H24
Public Const GWL_WNDPROC = -4
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
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal ByteLen As Long)
Dim WndProc As Long
Sub HookForm(hWnd As Long)
WndProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
Sub UnHookForm(hWnd As Long)
Call SetWindowLong(hWnd, GWL_WNDPROC, WndProc)
End Sub
Public Function WindowProc(ByVal hWnd As Long, ByVal message As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Select Case message
Case WM_GETMINMAXINFO
WindowProc = CallWindowProc(WndProc, hWnd, message, wParam, lParam)
Dim MinMax As MINMAXINFO
CopyMemory MinMax, ByVal lParam, Len(MinMax)
MinMax.ptMinTrackSize.x = 200
MinMax.ptMinTrackSize.y = 200
CopyMemory ByVal lParam, MinMax, Len(MinMax)
Case Else
WindowProc = CallWindowProc(WndProc, hWnd, message, wParam, lParam)
End Select
End Function
в модуле формы
Private Sub Form_Load()
Call HookForm(hWnd)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call UnHookForm(hWnd)
End Sub