BOOL CObjectDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(WM_MOUSEMOVE == pMsg->message)
{
CRect rect;
m_list.GetClientRect(rect);
CRect rcw;
m_list.GetWindowRect(&rcw);
CPoint point = pMsg->pt;
point.x -= rcw.left;
point.y -= rcw.top;
if(rect.right>=point.x && rect.left <=point.x && rect.top <=point.y && rect.bottom>=point.y)
{
int nIndex = m_list.HitTest(point);
if (nIndex != -1)
{
point.x += rcw.left;
point.y += rcw.top;
m_pChild->m_pCObjTreeDlg->OnCreateItem(m_pCurObjType->GetImageList(), nIndex, point);
}
else
{
m_pChild->m_pCObjTreeDlg->SetWindowPos(NULL, -1000, -1000, 0, 0, SWP_HIDEWINDOW);
}
}
else
{
m_pChild->m_pCObjTreeDlg->SetWindowPos(NULL, -1000, -1000, 0, 0, SWP_HIDEWINDOW);
}
}
return CDialog::PreTranslateMessage(pMsg);
}