var
OldWndProc: Pointer;
function ClientWndProc(Wnd: HWnd; Msg: Cardinal; wParam, lParam: Integer): Integer; stdcall;
var
Style: Integer;
begin
if Msg = WM_NCCALCSIZE then
begin
Style := GetWindowLong(Wnd, GWL_STYLE);
if (Style and (WS_HSCROLL or WS_VSCROLL)) <> 0 then
SetWindowLong(Wnd, GWL_STYLE, Style and not (WS_HSCROLL or WS_VSCROLL));
end;
Result := CallWindowProc(OldWndProc,Wnd,Msg,wParam,lParam);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
OldWndProc := Pointer(GetWindowLong(ListView1.Handle,GWL_WNDPROC));
SetWindowLong(ListView1.Handle, GWL_WNDPROC,Integer(@ClientWndProc));
end;