How to get point for SubItemHitTest in CListCtrl?
Hi,
When using SubItemHitTest I need to fill the structure LPLVHITTESTINFO item point with the point clicked in the CListCtrl.
How do I get that point?
When using the message NM_CLICK I only get a NMHDR and LRESULT, not a point clicked.
Please help.
Regards,
Maurice
Re: How to get point for SubItemHitTest in CListCtrl?
Quote:
Originally posted by Maurice Sanders
Hi,
When using SubItemHitTest I need to fill the structure LPLVHITTESTINFO item point with the point clicked in the CListCtrl.
How do I get that point?
When using the message NM_CLICK I only get a NMHDR and LRESULT, not a point clicked.
Please help.
Regards,
Maurice
this should help:
PHP Code:
// 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);
}