This documentation is archived and is not being maintained.

CListCtrl::SubItemHitTest

Determines which list view item, if any, is at a given position.

int SubItemHitTest(
   LPLVHITTESTINFO pInfo 
);

Parameters

pInfo
A pointer to the LVHITTESTINFO structure.

Return Value

The one-based index of the item, or subitem, being tested (if any), or -1 otherwise.

Remarks

This member function implements the behavior of the Win32 macro, ListView_SubItemHitTest, as described in the Platform SDK.

Example

// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
// The pointer where the mouse was clicked.
extern CPoint myPoint;

LVHITTESTINFO lvhti;

// Clear the subitem text the user clicked on.
lvhti.pt = myPoint;
pmyListCtrl->SubItemHitTest(&lvhti);

if (lvhti.flags & LVHT_ONITEMLABEL)
{
   pmyListCtrl->SetItemText(lvhti.iItem, lvhti.iSubItem, NULL);
}

See Also

CListCtrl Overview | Class Members | Hierarchy Chart

Show: