I could find a class in my MFC directory... :)
class CDragListBox : public CListBox
{
...
public:
virtual void Dropped(_In_ int nSrcIndex, _In_ CPoint pt);
...
BOOL CDragListBox::OnChildNotify(UINT nMessage, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
if (nMessage != m_nMsgDragList)
return CListBox::OnChildNotify(nMessage, wParam, lParam, pResult);
ASSERT(pResult != NULL);
LPDRAGLISTINFO pInfo = (LPDRAGLISTINFO)lParam;
ASSERT(pInfo != NULL);
switch (pInfo->uNotification)
{
case DL_BEGINDRAG:
*pResult = BeginDrag(pInfo->ptCursor);
break;
case DL_CANCELDRAG:
CancelDrag(pInfo->ptCursor);
break;
case DL_DRAGGING:
*pResult = Dragging(pInfo->ptCursor);
break;
case DL_DROPPED:
Dropped(GetCurSel(), pInfo->ptCursor);
break;
}
return TRUE;
}