DC ownerdrawn background mode

Fabian Cenedese Cenedese at indel.ch
Thu Dec 18 09:28:02 CST 2003


Hi

I have a control derived from CListCtrl. It's completely ownerdrawn. The
problem comes when some item is selected. The whole column is drawn
selected but the text is drawn with the actual back color instead of
transparent. As this is white I get white text on white background... very
readable :)

I found that the difference between Windows and wine is the background
mode. In Windows it's transparent whereas in wine it's opaque. I never
change the background mode in my app, I guess I just lived from the
fact that it's default transparent. Where is this set? Is this a wrong
default parameter in wine or do I explicitly have to set the background
mode in my app? I can do this, then it shows ok. But that's another
change to my application I have to do because of wine. Maybe other
apps may have similar problems.

bye  Fabi

// from my code:

void CMyCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) 
{
	// Prepare and test device context
	CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);

	// this is 1 for windows but 2 for wine
	// pDC->GetBkMode();

	// wine fix
	pDC->SetBkMode(TRANSPARENT);





More information about the wine-devel mailing list