Buggy code:
public class Slider extends Control { int increment ; int pageIncrement ; boolean ignoreFocus ; static final int ScrollBarProc ; static final TCHAR ScrollBarClass = new TCHAR ( 0 , "SCROLLBAR" , true ) ; public Slider ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createWidget ( ) { } int defaultBackground ( ) { } int defaultForeground ( ) { } void enableWidget ( boolean enabled ) { } public boolean getEnabled ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public int getSelection ( ) { } public int getThumb ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setBounds ( int x , int y , int width , int height , int flags ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } boolean SetScrollInfo ( int hwnd , int flags , SCROLLINFO info , boolean fRedraw ) { } public void setSelection ( int value ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } int widgetExtStyle ( ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_KEYDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDBLCLK ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT wmScrollChild ( int wParam , int lParam ) { <START_BUG> int code = wParam & 65535 ; <END_BUG> if ( code == ( OS . SB_ENDSCROLL ) ) return null ; Event event = new Event ( ) ; SCROLLINFO info = new SCROLLINFO ( ) ; info . cbSize = SCROLLINFO . sizeof ; info . fMask = ( ( OS . SIF_TRACKPOS ) | ( OS . SIF_POS ) ) | ( OS . SIF_RANGE ) ; OS . GetScrollInfo ( handle , SB_CTL , info ) ; info . fMask = OS . SIF_POS ; switch ( code ) { case OS . SB_THUMBPOSITION : event . detail = SWT . NONE ; info . nPos = info . nTrackPos ; break ; case OS . SB_THUMBTRACK : event . detail = SWT . DRAG ; info . nPos = info . nTrackPos ; break ; case OS . SB_TOP : event . detail = SWT . HOME ; info . nPos = info . nMin ; break ; case OS . SB_BOTTOM : event . detail = SWT . END ; info . nPos = info . nMax ; break ; case OS . SB_LINEDOWN : event . detail = SWT . ARROW_DOWN ; info . nPos += increment ; break ; case OS . SB_LINEUP : event . detail = SWT . ARROW_UP ; info . nPos = Math . max ( info . nMin , ( ( info . nPos ) - ( increment ) ) ) ; break ; case OS . SB_PAGEDOWN : event . detail = SWT . PAGE_DOWN ; info . nPos += pageIncrement ; break ; case OS . SB_PAGEUP : event . detail = SWT . PAGE_UP ; info . nPos = Math . max ( info . nMin , ( ( info . nPos ) - ( pageIncrement ) ) ) ; break ; } OS . SetScrollInfo ( handle , SB_CTL , info , true ) ; sendEvent ( Selection , event ) ; return null ; } }

Fix:
int code = OS . LOWORD ( wParam ) ;