Hi.
My CListCtrl is called m_List, which i've populated with some data. i've added an event (NM_CLICK) with the expectation that i could use HitTest to determine which row number was highlighted. The code is as follows...
void CTls2csvDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
CPoint mypoint;
UINT uFlags;
int pos1 = m_List.HitTest(mypoint, &uFlags);
// Write to status bar
sprintf(stat, "click Line Number = %i", pos1);
SendDlgItemMessage( IDC_STATUS, SB_SETTEXT, 0,
(LPARAM)stat);
UpdateData(FALSE);
*pResult = 0;
}
All that gets sent to the status bar is -1.
i'm obviously doing something totally stupid, but can someone please give me a clue?
Thanks in Advance
Dave H.
My CListCtrl is called m_List, which i've populated with some data. i've added an event (NM_CLICK) with the expectation that i could use HitTest to determine which row number was highlighted. The code is as follows...
void CTls2csvDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
CPoint mypoint;
UINT uFlags;
int pos1 = m_List.HitTest(mypoint, &uFlags);
// Write to status bar
sprintf(stat, "click Line Number = %i", pos1);
SendDlgItemMessage( IDC_STATUS, SB_SETTEXT, 0,
(LPARAM)stat);
UpdateData(FALSE);
*pResult = 0;
}
All that gets sent to the status bar is -1.
i'm obviously doing something totally stupid, but can someone please give me a clue?
Thanks in Advance
Dave H.