CListCtrl hittest always returns -1

  • Thread starter Thread starter freelsd
  • Start date Start date
F

freelsd

Guest
Ive got list control with report style and i need to copy some text from ItemData, but when iam trying to make hittest it always returns -1


void Cmfc_test123Dlg::OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
CPoint pt(GetMessagePos());
ScreenToClient(&pt);
//UINT uFlags = LVHT_ONITEM;
// Find the subitem
LVHITTESTINFO hitinfo = {0};
//hitinfo.flags = nFlags;
hitinfo.pt = pt;
int N = m_ctrlList.HitTest(pt, NULL);
//int nRow = 0, nCol = 0;
//int nInt = m_ctrlList.HitTest(pt, NULL);
CString sMsg;
sMsg.Format("%d",N);
MessageBox(sMsg, NULL, MB_OK);
//m_ctrlList.


}

Continue reading...
 
Back
Top