Ending the Tree-View Drag Operation
The follow example ends a drag operation. The ImageList_EndDrag function is called when the parent window receives a WM_LBUTTONUP message.
// Main_OnLButtonUp - stops dragging a tree-view item, releases the
// mouse capture, and shows the mouse cursor.
//
// Global variable
// g_fDragging - indicates whether a drag operation is underway.
void Main_OnLButtonUp(void)
{
if (g_fDragging) {
ImageList_EndDrag();
ReleaseCapture();
ShowCursor(TRUE);
g_fDragging = FALSE;
}
return;
}