function Form1.ItemAtPos(TabControlHandle : HWND; X, Y : Integer) : Integer;
var
HitTestInfo : TTCHitTestInfo;
HitIndex : Integer;
begin
HitTestInfo.pt.x := X;
HitTestInfo.pt.y := Y;
HitTestInfo.flags := 0;
HitIndex := SendMessage(TabControlHandle, TCM_HITTEST, 0, Longint(@HitTestInfo));
Result := HitIndex;
end;
|