List box hit testing doesn't work properly in Windows XP.
This is from code I found either at codeguru or codeproject. This is MFC, but you should be able to convert to Win32 quite easily.
UINT CAddSeqDlg::ItemFromPointNT(CPoint pt, BOOL& bOutside) const
// CListBox::ItemFromPoint does not work on NT.
if (m_lstFrames.GetCount()==0) return -1;
int nFirstIndex, nLastIndex;
nFirstIndex = m_lstFrames.GetTopIndex();
nLastIndex = nFirstIndex + m_lstFrames.GetCount();
bOutside = TRUE;
int nResult = -1;
for (int i = nFirstIndex;nResult==-1 && i<=nLastIndex;i++)
nResult = i;
bOutside = FALSE;