if ((clrBackground & 0xFFFFFF) == OS.GetSysColor (OS.COLOR_WINDOW)) { clrBackground = 0x0200FF00; }
void setCheckboxImageList () {	if ((style & SWT.CHECK) == 0) return;	int count = 5, flags = 0;	if (OS.IsWinCE) {		flags |= OS.ILC_COLOR;	} else {		if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {			flags |= OS.ILC_COLOR32;		} else {			int hDC = OS.GetDC (handle);			int bits = OS.GetDeviceCaps (hDC, OS.BITSPIXEL);			int planes = OS.GetDeviceCaps (hDC, OS.PLANES);			OS.ReleaseDC (handle, hDC);			int depth = bits * planes;			switch (depth) {				case 4: flags |= OS.ILC_COLOR4; break;				case 8: flags |= OS.ILC_COLOR8; break;				case 16: flags |= OS.ILC_COLOR16; break;				case 24: flags |= OS.ILC_COLOR24; break;				case 32: flags |= OS.ILC_COLOR32; break;				default: flags |= OS.ILC_COLOR; break;			}			flags |= OS.ILC_MASK;		}	}	if ((style & SWT.RIGHT_TO_LEFT) != 0) flags |= OS.ILC_MIRROR;	int height = OS.SendMessage (handle, OS.TVM_GETITEMHEIGHT, 0, 0), width = height;	int hStateList = OS.ImageList_Create (width, height, flags, count, count);	int hDC = OS.GetDC (handle);	int memDC = OS.CreateCompatibleDC (hDC);	int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);	int hOldBitmap = OS.SelectObject (memDC, hBitmap);	RECT rect = new RECT ();	OS.SetRect (rect, 0, 0, width * count, height);	/*	* NOTE: DrawFrameControl() draws a black and white	* mask when not drawing a push button.  In order to	* make the box surrounding the check mark transparent,	* fill it with a color that is neither black or white.	*/	int clrBackground = 0;	if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {		Control control = findBackgroundControl ();		if (control == null) control = this;		clrBackground = control.getBackgroundPixel ();	} else {		clrBackground = 0x020000FF;	}	int hBrush = OS.CreateSolidBrush (clrBackground);	OS.FillRect (memDC, rect, hBrush);	OS.DeleteObject (hBrush);	int oldFont = OS.SelectObject (hDC, defaultFont ());	TEXTMETRIC tm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();	OS.GetTextMetrics (hDC, tm);	OS.SelectObject (hDC, oldFont);	int itemWidth = Math.min (tm.tmHeight, width);	int itemHeight = Math.min (tm.tmHeight, height);	int left = (width - itemWidth) / 2, top = (height - itemHeight) / 2 + 1;	OS.SetRect (rect, left + width, top, left + width + itemWidth, top + itemHeight);	if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {		int hTheme = OS.OpenThemeData (handle, BUTTON);		OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);		rect.left += width;  rect.right += width;		OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_CHECKEDNORMAL, rect, null);		rect.left += width;  rect.right += width;		OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);		rect.left += width;  rect.right += width;		OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_MIXEDNORMAL, rect, null);		OS.CloseThemeData (hTheme);	} else {		OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_FLAT);		rect.left += width;  rect.right += width;		OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_FLAT);		rect.left += width;  rect.right += width;		OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_INACTIVE | OS.DFCS_FLAT);		rect.left += width;  rect.right += width;		OS.DrawFrameControl (memDC, rect, OS.DFC_BUTTON, OS.DFCS_BUTTONCHECK | OS.DFCS_CHECKED | OS.DFCS_INACTIVE | OS.DFCS_FLAT);	}	OS.SelectObject (memDC, hOldBitmap);	OS.DeleteDC (memDC);	OS.ReleaseDC (handle, hDC);	if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {		OS.ImageList_Add (hStateList, hBitmap, 0);	} else {		OS.ImageList_AddMasked (hStateList, hBitmap, clrBackground);	}	OS.DeleteObject (hBitmap);	int hOldStateList = OS.SendMessage (handle, OS.TVM_GETIMAGELIST, OS.TVSIL_STATE, 0);	OS.SendMessage (handle, OS.TVM_SETIMAGELIST, OS.TVSIL_STATE, hStateList);	if (hOldStateList != 0) OS.ImageList_Destroy (hOldStateList);}