如何获取 TListView 的列 header 高度?

How to get the column header height of a TListView?

TListView 中,我想获取列表客户区开始处的第一个垂直像素。通常,它从 0 开始,但是当出现 header 时,它从 header 高度开始。

获取 header 句柄(替代方案 - 使用相应的 LVM_GETHEADER 消息)并通过任何方法检索其大小。

uses ... commctrl;

var
  h: THandle;
  r: TRect;
begin
  h := ListView_GetHeader(ListView2.Handle);
  GetWindowRect(h, r);
  Caption := IntToStr(r.Bottom - r.Top);