Buggy code:
return 1 ; } } } } break ; } } return callWindowProc ( hwnd , msg , wParam , lParam ) ; } if ( ( ( hwndParent ) != 0 ) && ( hwnd == ( hwndParent ) ) ) { switch ( msg ) { case OS . WM_MOVE : { sendEvent ( Move ) ; return 0 ; } case OS . WM_SIZE : { setScrollWidth ( ) ; if ( ignoreResize ) return 0 ; setResizeChildren ( false ) ; int code = callWindowProc ( hwnd , WM_SIZE , wParam , lParam ) ; sendEvent ( Resize ) ; if ( isDisposed ( ) ) return 0 ; if ( ( layout ) != null ) { markLayout ( false , false ) ; updateLayout ( false , false ) ; } setResizeChildren ( true ) ; updateScrollBar ( ) ; return code ; } case OS . WM_NCPAINT : { LRESULT result = wmNCPaint ( hwnd , wParam , lParam ) ; if ( result != null ) return result . value ; break ; } case OS . WM_PRINT : { LRESULT result = wmPrint ( hwnd , wParam , lParam ) ; if ( result != null ) return result . value ; break ; } case OS . WM_COMMAND : case OS . WM_NOTIFY : case OS . WM_SYSCOLORCHANGE : { return OS . SendMessage ( handle , msg , wParam , lParam ) ; } case OS . WM_HSCROLL : { if ( ( ( horizontalBar ) != null ) && ( ( lParam == 0 ) || ( lParam == ( hwndParent ) ) ) ) { wmScroll ( horizontalBar , true , hwndParent , WM_HSCROLL , wParam , lParam ) ; } setScrollWidth ( ) ; break ; } case OS . WM_VSCROLL : { SCROLLINFO info = new SCROLLINFO ( ) ; info . cbSize = SCROLLINFO . sizeof ; info . fMask = OS . SIF_ALL ; OS . GetScrollInfo ( hwndParent , SB_VERT , info ) ; if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 6 , 0 ) ) ) ) { if ( ( OS . LOWORD ( wParam ) ) == ( OS . SB_THUMBTRACK ) ) { info . nPos = info . nTrackPos ; } } OS . SetScrollInfo ( handle , SB_VERT , info , true ) ; int code = OS . SendMessage ( handle , WM_VSCROLL , wParam , lParam ) ; OS . GetScrollInfo ( handle , SB_VERT , info ) ; OS . SetScrollInfo ( hwndParent , SB_VERT , info , true ) ; return code ; } } return callWindowProc ( hwnd , msg , wParam , lParam ) ; } if ( msg == ( Display . DI_GETDRAGIMAGE ) ) { <START_BUG> if ( ( ( ( getSelectionCount ( ) ) != 1 ) || ( hooks ( EraseItem ) ) ) || ( hooks ( PaintItem ) ) ) { <END_BUG> POINT mousePos = new POINT ( ) ; OS . POINTSTOPOINT ( mousePos , OS . GetMessagePos ( ) ) ; OS . MapWindowPoints ( 0 , handle , mousePos , 1 ) ; RECT clientRect = new RECT ( ) ; OS . GetClientRect ( handle , clientRect ) ; int hItem = OS . SendMessage ( handle , TVM_GETNEXTITEM , TVGN_FIRSTVISIBLE , 0 ) ; TreeItem [ ] items = new TreeItem [ 10 ] ; TVITEM tvItem = new TVITEM ( ) ; tvItem . mask = ( ( OS . TVIF_HANDLE ) | ( OS . TVIF_PARAM ) ) | ( OS . TVIF_STATE ) ; int count = getSelection ( hItem , tvItem , items , 0 , 10 , false , true ) ; RECT rect = items [ 0 ] . getBounds ( 0 , true , false , false ) ; if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { int width = Tree . DRAG_IMAGE_SIZE ; rect . left = Math . max ( clientRect . left , ( ( mousePos . x ) - ( width // 2 ) ) ) ; if ( ( clientRect . right ) > ( ( rect . left ) + width ) ) { rect . right = ( rect . left ) + width ; } else { rect . right = clientRect . right ; rect . left = Math . max ( clientRect . left , ( ( rect . right ) - width ) ) ; } } int hRgn = OS . CreateRectRgn ( rect . left , rect . top , rect . right , rect . bottom ) ; for ( int i = 1 ; i < count ; i ++ ) { if ( ( ( rect . bottom ) - ( rect . top ) ) > ( Tree . DRAG_IMAGE_SIZE ) ) break ; if ( ( rect . bottom ) > ( clientRect . bottom ) ) break ; RECT itemRect = items [ i ] . getBounds ( 0 , true , false , false ) ; if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { itemRect . left = rect . left ; itemRect . right = rect . right ; } int rectRgn = OS . CreateRectRgn ( itemRect . left , itemRect . top , itemRect . right , itemRect . bottom ) ;

Fix:
if ( ( ( ( ( style ) & ( SWT . MULTI ) ) != 0 ) || ( hooks ( EraseItem ) ) ) || ( hooks ( PaintItem ) ) ) {