+#ifndef __WXWINCE__
+ if ( m_htClickedItem )
+ {
+ int cx = abs(m_ptClick.x - x);
+ int cy = abs(m_ptClick.y - y);
+
+ if ( cx > GetSystemMetrics( SM_CXDRAG ) || cy > GetSystemMetrics( SM_CYDRAG ) )
+ {
+ HWND pWnd = ::GetParent( GetHwnd() );
+ if ( pWnd )
+ {
+ NM_TREEVIEW tv;
+
+ tv.hdr.hwndFrom = GetHwnd();
+ tv.hdr.idFrom = ::GetWindowLong( GetHwnd(), GWL_ID );
+ tv.hdr.code = TVN_BEGINDRAG;
+
+ tv.itemNew.hItem = HITEM(m_htClickedItem);
+
+ TVITEM tviAux;
+ ZeroMemory(&tviAux, sizeof(tviAux));
+ tviAux.hItem = HITEM(m_htClickedItem);
+ tviAux.mask = TVIF_STATE | TVIF_PARAM;
+ tviAux.stateMask = 0xffffffff;
+ TreeView_GetItem( GetHwnd(), &tviAux );
+
+ tv.itemNew.state = tviAux.state;
+ tv.itemNew.lParam = tviAux.lParam;
+
+ tv.ptDrag.x = x;
+ tv.ptDrag.y = y;
+
+ ::SendMessage( pWnd, WM_NOTIFY, tv.hdr.idFrom, (LPARAM)&tv );
+ }
+ m_htClickedItem.Unset();
+ }
+ }
+#endif // __WXWINCE__
+