I have developed an application, which having two list views on a dialog box. Que- How I come to know, where the mouse curser is present, I mean on which list view the mouse is moving. I have used mouse move event, Its working for both list view. I would like to k开发者_开发知识库now the which list is current on which mouse is moving.
I think you are handling the mouse event in the main dialog where the list view is created. If you really want to handle the mouse movement of your list view you need to sub class the list view and handle it there.
If you can state your requirements clearly may be we can help you better. Why you need to know your mouse positions in the list view?
This may help you.
afx_msg void OnLvnHotTrackList1(NMHDR *pNMHDR, LRESULT *pResult);
ON_NOTIFY(LVN_HOTTRACK, IDC_LIST1, OnLvnHotTrackList1)
void OnLvnHotTrackList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
CPoint pt(GetMessagePos());
*pResult = 0;
}
精彩评论