int itemHeight = (oneItem >> 16) - (empty >> 16); setCheckboxImageList (itemHeight, itemHeight, false);
int width = (oneItem >> 16) - (empty >> 16), height = width; setCheckboxImageList (width, height, false);
void createHandle () {	super.createHandle ();	state &= ~(CANVAS | THEME_BACKGROUND);		/* Use the Explorer theme */	if (EXPLORER_THEME) {		if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {			explorerTheme = true;			OS.SetWindowTheme (handle, Display.EXPLORER, null);		}	}		/* Get the header window proc */	if (HeaderProc == 0) {		int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);		HeaderProc = OS.GetWindowLong (hwndHeader, OS.GWL_WNDPROC);	}		/*	* Feature in Windows.  In version 5.8 of COMCTL32.DLL,	* if the font is changed for an item, the bounds for the	* item are not updated, causing the text to be clipped.	* The fix is to detect the version of COMCTL32.DLL, and	* if it is one of the versions with the problem, then	* use version 5.00 of the control (a version that does	* not have the problem).  This is the recomended work	* around from the MSDN.	*/	if (!OS.IsWinCE) {		if (OS.COMCTL32_MAJOR < 6) {			OS.SendMessage (handle, OS.CCM_SETVERSION, 5, 0);		}	}		/* 	* This code is intentionally commented.  According to	* the documentation, setting the default item size is	* supposed to improve performance.  By experimentation,	* this does not seem to have much of an effect.	*/	//	OS.SendMessage (handle, OS.LVM_SETITEMCOUNT, 1024 * 2, 0);	/* Set the checkbox image list */	if ((style & SWT.CHECK) != 0) {		int empty = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 0, 0);		int oneItem = OS.SendMessage (handle, OS.LVM_APPROXIMATEVIEWRECT, 1, 0);		int itemHeight = (oneItem >> 16) - (empty >> 16);		setCheckboxImageList (itemHeight, itemHeight, false);		OS.SendMessage (handle, OS. LVM_SETCALLBACKMASK, OS.LVIS_STATEIMAGEMASK, 0);	}	/*	* Feature in Windows.  When the control is created,	* it does not use the default system font.  A new HFONT	* is created and destroyed when the control is destroyed.	* This means that a program that queries the font from	* this control, uses the font in another control and then	* destroys this control will have the font unexpectedly	* destroyed in the other control.  The fix is to assign	* the font ourselves each time the control is created.	* The control will not destroy a font that it did not	* create.	*/	int hFont = OS.GetStockObject (OS.SYSTEM_FONT);	OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0);	/*	* Bug in Windows.  When the first column is inserted	* without setting the header text, Windows will never	* allow the header text for the first column to be set.	* The fix is to set the text to an empty string when	* the column is inserted.	*/	LVCOLUMN lvColumn = new LVCOLUMN ();	lvColumn.mask = OS.LVCF_TEXT | OS.LVCF_WIDTH;	int hHeap = OS.GetProcessHeap ();	int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);	lvColumn.pszText = pszText;	OS.SendMessage (handle, OS.LVM_INSERTCOLUMN, 0, lvColumn);	OS.HeapFree (hHeap, 0, pszText);	/* Set the extended style bits */	int bits1 = OS.LVS_EX_LABELTIP;	if ((style & SWT.FULL_SELECTION) != 0) bits1 |= OS.LVS_EX_FULLROWSELECT;	if (OS.COMCTL32_MAJOR >= 6) bits1 |= OS.LVS_EX_DOUBLEBUFFER;	OS.SendMessage (handle, OS.LVM_SETEXTENDEDLISTVIEWSTYLE, bits1, bits1);		/*	* Feature in Windows.  Windows does not explicitly set the orientation of	* the header.  Instead, the orientation is inherited when WS_EX_LAYOUTRTL	* is specified for the table.  This means that when both WS_EX_LAYOUTRTL	* and WS_EX_NOINHERITLAYOUT are specified for the table, the header will	* not be oriented correctly.  The fix is to explicitly set the orientation	* for the header.	* 	* NOTE: WS_EX_LAYOUTRTL is not supported on Windows NT.	*/	if (OS.WIN32_VERSION < OS.VERSION (4, 10)) return;	if ((style & SWT.RIGHT_TO_LEFT) != 0) {		int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);		int bits2 = OS.GetWindowLong (hwndHeader, OS.GWL_EXSTYLE);		OS.SetWindowLong (hwndHeader, OS.GWL_EXSTYLE, bits2 | OS.WS_EX_LAYOUTRTL);	}}