MouseMove example for C++ 5.0 and later
float gLastX = 0, gLastY = 0;
void CBrowseDlg::OnMouseMove Leadimglistctrl1(short Button, short Shift, float x, float y)
{
gLastX = x;
gLastY = y;
}
void CBrowseDlg::OnClickLeadimglistctrl1()
{
long lIndex;
//manual selection?
if( m_LEADImageList.GetAllowSelection() == IMGLST_ALLOWSELECTION_NONE)
{
lIndex = m_LEADImageList.HitTest(gLastX, gLastY); //did we hit an item?
if( lIndex >= 0 && lIndex < m_LEADImageList.GetCount())
{
//set item as selected
m_LEADImageList.SelectAll(FALSE);
//make sure the item is selected
m_LEADImageList.Item (lIndex).SetSelected(TRUE );
}
}
}