Export (0) Print
Expand All
MFC
Expand Minimize

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.

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

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

// 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);
}

Community Additions

ADD
Show:
© 2014 Microsoft