uses windows;
var
PrevWndProc: WNDPROC;
function WndCallback(AHWND: HWND; uMsg: UINT; wParam: WParam; lParam: LParam): LRESULT; stdcall;
begin
case uMsg of
WM_GETMINMAXINFO:
begin
PMinMaxInfo(LParam)^.ptMaxSize.x := 400;
PMinMaxInfo(LParam)^.ptMaxSize.y := 400;
Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, lparam);
Exit;
end;
{ WM_OtherStuffHere
begin
end;}
end;
Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
PrevWndProc := Windows.WNDPROC(SetWindowLongPtr(Self.Handle, GWL_WNDPROC, PtrInt(@WndCallback)));
end;