G
Guest
Hi,
I get LVHITTESTINFO::Flag=LVHT_NOWHERE when I do a Hit Test in my ListView.
The list containts items and subitems created with designer. Clicking
anywhere in the list makes not HitTest return valid Index (return -1). Why?
Hugo
// Called by ListView::MouseUp with x=e->get_X() and y=e->get_Y()
bool Main::GetModeSettingFieldParam(int x, int y, int* pItemIndex, int*
pSubItemIndex, System:rawing::Rectangle* pBounds)
{
LVHITTESTINFO HitTestInfo;
HitTestInfo.pt.x = x;
HitTestInfo.pt.x = y;
ModeSetting->Focus();
/**pItemIndex =*/ SendMessage(GetFocus(), LVM_SUBITEMHITTEST, 0, (LPARAM)
&HitTestInfo);
//ListView_SubItemHitTest(GetFocus(), &HitTestInfo);
*pItemIndex = HitTestInfo.iItem;
*pSubItemIndex = HitTestInfo.iSubItem;
System:iagnostics::Trace::Write((*pItemIndex).ToString(), S"Index ");
System:iagnostics::Trace::Write((*pSubItemIndex).ToString(), S" ; SubIndex
");
System:iagnostics::Trace::WriteLine(HitTestInfo.flags.ToString(), S" ;
Flag ");
return *pItemIndex != -1;
}
I get LVHITTESTINFO::Flag=LVHT_NOWHERE when I do a Hit Test in my ListView.
The list containts items and subitems created with designer. Clicking
anywhere in the list makes not HitTest return valid Index (return -1). Why?
Hugo
// Called by ListView::MouseUp with x=e->get_X() and y=e->get_Y()
bool Main::GetModeSettingFieldParam(int x, int y, int* pItemIndex, int*
pSubItemIndex, System:rawing::Rectangle* pBounds)
{
LVHITTESTINFO HitTestInfo;
HitTestInfo.pt.x = x;
HitTestInfo.pt.x = y;
ModeSetting->Focus();
/**pItemIndex =*/ SendMessage(GetFocus(), LVM_SUBITEMHITTEST, 0, (LPARAM)
&HitTestInfo);
//ListView_SubItemHitTest(GetFocus(), &HitTestInfo);
*pItemIndex = HitTestInfo.iItem;
*pSubItemIndex = HitTestInfo.iSubItem;
System:iagnostics::Trace::Write((*pItemIndex).ToString(), S"Index ");
System:iagnostics::Trace::Write((*pSubItemIndex).ToString(), S" ; SubIndex
");
System:iagnostics::Trace::WriteLine(HitTestInfo.flags.ToString(), S" ;
Flag ");
return *pItemIndex != -1;
}