Handling a click is very similar to handling a right click. Here is some sample code. This code goes in the parent's window procedure.
Code:
case WM_NOTIFY:
lpnmhdr = (LPNMHDR)lParam;
if(lpnmhdr->hwndFrom == hwndList)
{
if(lpnmhdr->code == NM_CLICK)
{
LPNMITEMACTIVATE lpnmitem = (LPNMITEMACTIVATE) lParam;
LVHITTESTINFO hti = { 0 };
hti.pt = lpnmitem->ptAction;
ListView_HitTest(hListView, &hti);
if(hti.flags & LVHT_ONITEM)
{
TCHAR buf[100];
wsprintf(buf, TEXT("Item No. %d was clicked."), hti.iItem);
MessageBox(NULL, buf, NULL, 0);
}
}
}
break;