Buggy code:
newBits = ( oldBits | ( OS . WS_CLIPSIBLINGS ) ) | ( OS . WS_CLIPCHILDREN ) ; if ( newBits != oldBits ) OS . SetWindowLong ( handle , GWL_STYLE , newBits ) ; } PAINTSTRUCT ps = new PAINTSTRUCT ( ) ; if ( hooks ( Paint ) ) { boolean bufferedPaint = false ; if ( ( ( style ) & ( SWT . DOUBLE_BUFFERED ) ) != 0 ) { if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 6 , 0 ) ) ) ) { if ( ( ( style ) & ( ( SWT . NO_MERGE_PAINTS ) | ( SWT . RIGHT_TO_LEFT ) ) ) == 0 ) { if ( ( ( style ) & ( SWT . TRANSPARENT ) ) == 0 ) bufferedPaint = true ; } } } if ( bufferedPaint ) { int hDC = OS . BeginPaint ( handle , ps ) ; int width = ( ps . right ) - ( ps . left ) ; int height = ( ps . bottom ) - ( ps . top ) ; if ( ( width != 0 ) && ( height != 0 ) ) { int [ ] phdc = new int [ 1 ] ; int flags = OS . BPBF_COMPATIBLEBITMAP ; RECT prcTarget = new RECT ( ) ; OS . SetRect ( prcTarget , ps . left , ps . top , ps . right , ps . bottom ) ; int hBufferedPaint = OS . BeginBufferedPaint ( hDC , prcTarget , flags , null , phdc ) ; GCData data = new GCData ( ) ; data . device = display ; data . foreground = getForegroundPixel ( ) ; Control control = findBackgroundControl ( ) ; if ( control == null ) control = this ; data . background = control . getBackgroundPixel ( ) ; data . font = Font . win32_new ( display , OS . SendMessage ( handle , WM_GETFONT , 0 , 0 ) ) ; data . uiState = ( ( int ) ( OS . SendMessage ( handle , WM_QUERYUISTATE , 0 , 0 ) ) ) ; if ( ( ( style ) & ( SWT . NO_BACKGROUND ) ) != 0 ) { } else { RECT rect = new RECT ( ) ; OS . SetRect ( rect , ps . left , ps . top , ps . right , ps . bottom ) ; drawBackground ( phdc [ 0 ] , rect ) ; } GC gc = GC . win32_new ( phdc [ 0 ] , data ) ; Event event = new Event ( ) ; event . gc = gc ; event . x = ps . left ; event . y = ps . top ; event . width = width ; event . height = height ; sendEvent ( Paint , event ) ; if ( ( data . focusDrawn ) && ( ! ( isDisposed ( ) ) ) ) updateUIState ( ) ; gc . dispose ( ) ; OS . EndBufferedPaint ( hBufferedPaint , true ) ; } OS . EndPaint ( handle , ps ) ; } else { GCData data = new GCData ( ) ; data . ps = ps ; data . hwnd = handle ; GC gc = GC . win32_new ( this , data ) ; int sysRgn = 0 ; if ( ( ( ( style ) & ( ( SWT . DOUBLE_BUFFERED ) | ( SWT . TRANSPARENT ) ) ) != 0 ) || ( ( ( style ) & ( SWT . NO_MERGE_PAINTS ) ) != 0 ) ) { sysRgn = OS . CreateRectRgn ( 0 , 0 , 0 , 0 ) ; if ( ( OS . GetRandomRgn ( gc . handle , sysRgn , SYSRGN ) ) == 1 ) { <START_BUG> if ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 4 , 10 ) ) ) { <END_BUG> if ( ( ( OS . GetLayout ( gc . handle ) ) & ( OS . LAYOUT_RTL ) ) != 0 ) { int nBytes = OS . GetRegionData ( sysRgn , 0 , null ) ; int [ ] lpRgnData = new int [ nBytes // 4 ] ; OS . GetRegionData ( sysRgn , nBytes , lpRgnData ) ; int newSysRgn = OS . ExtCreateRegion ( new float [ ] { - 1 , 0 , 0 , 1 , 0 , 0 } , nBytes , lpRgnData ) ; OS . DeleteObject ( sysRgn ) ; sysRgn = newSysRgn ; } } if ( OS . IsWinNT ) { POINT pt = new POINT ( ) ; OS . MapWindowPoints ( 0 , handle , pt , 1 ) ; OS . OffsetRgn ( sysRgn , pt . x , pt . y ) ; } } } int width = ( ps . right ) - ( ps . left ) ; int height = ( ps . bottom ) - ( ps . top ) ; if ( ( width != 0 ) && ( height != 0 ) ) { GC paintGC = null ; Image image = null ; if ( ( ( style ) & ( ( SWT . DOUBLE_BUFFERED ) | ( SWT . TRANSPARENT ) ) ) != 0 ) { image = new Image ( display , width , height ) ; paintGC = gc ; gc = new GC ( image , ( ( paintGC . getStyle ( ) ) & ( SWT . RIGHT_TO_LEFT ) ) ) ; GCData gcData = gc . getGCData ( ) ; gcData . uiState = data . uiState ; gc . setForeground ( getForeground ( ) ) ;

Fix:
if ( ( ! ( OS . IsWinCE ) ) && ( ( OS . WIN32_VERSION ) >= ( OS . VERSION ( 4 , 10 ) ) ) ) {