-
October 10th, 2002, 02:28 AM
#1
How to get point for SubItemHitTest in CListCtrl?
Hi,
When using SubItemHitTest I need to fill the structure LPLVHITTESTINFO item point with the point clicked in the CListCtrl.
How do I get that point?
When using the message NM_CLICK I only get a NMHDR and LRESULT, not a point clicked.
Please help.
Regards,
Maurice
-
October 10th, 2002, 02:40 AM
#2
Re: How to get point for SubItemHitTest in CListCtrl?
Originally posted by Maurice Sanders
Hi,
When using SubItemHitTest I need to fill the structure LPLVHITTESTINFO item point with the point clicked in the CListCtrl.
How do I get that point?
When using the message NM_CLICK I only get a NMHDR and LRESULT, not a point clicked.
Please help.
Regards,
Maurice
this should help:
PHP Code:
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
// The pointer where the mouse was clicked.
extern CPoint myPoint;
LVHITTESTINFO lvhti;
// Clear the subitem text the user clicked on.
lvhti.pt = myPoint;
pmyListCtrl->SubItemHitTest(&lvhti);
if (lvhti.flags & LVHT_ONITEMLABEL)
{
pmyListCtrl->SetItemText(lvhti.iItem, lvhti.iSubItem, NULL);
}
-
October 10th, 2002, 02:56 AM
#3
Hi,
The example is clear to me. I saw that example already, but how do I get that point where the mouse is clicked in the CListCtrl?
That is what I really want to know.
How do I get that point in the NM_CLICK event of the CListCtrl.
Regards,
Maurice
-
October 10th, 2002, 04:14 AM
#4
Originally posted by Maurice Sanders
Hi,
The example is clear to me. I saw that example already, but how do I get that point where the mouse is clicked in the CListCtrl?
That is what I really want to know.
How do I get that point in the NM_CLICK event of the CListCtrl.
Regards,
Maurice
void CYourDlg::OnClickYourList(NMHDR* pNMHDR, LRESULT* pResult)
{
POINT point;
GetCursorPos(&point);
lvhti.pt = point;
.....................
}
-
October 10th, 2002, 04:31 AM
#5
Thanks,
The only thing that needs te be done is ScreenToClient and to offset the listcontrol. This offset is needed because I am using a CFormView and the listcontrol is in the middle of that form.
Regards,
Maurice
-
October 10th, 2002, 05:53 AM
#6
Originally posted by Maurice Sanders
Thanks,
The only thing that needs te be done is ScreenToClient and to offset the listcontrol. This offset is needed because I am using a CFormView and the listcontrol is in the middle of that form.
Regards,
Maurice
...yes, indeed, that i've omitted
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|