Newsgroups: comp.windows.ms.programmer
Path: utzoo!utgpu!watserv1!watmath!hyper.hyper.com!bonneau
From: bonneau@hyper.hyper.com (Paul Bonneau)
Subject: Re: icons and background color
Message-ID: <1991May28.174318.8541@hyper.hyper.com>
Reply-To: bonneau@hyper.UUCP (Paul Bonneau,,)
Organization: HyperCube Inc.
References: <3926@beguine.UUCP>
Date: Tue, 28 May 1991 17:43:18 GMT

In article <3926@beguine.UUCP> Jeffrey.Perry@bbs.acs.unc.edu
(Jeffrey Perry) writes:
>I have a fairly simple problem. I am just learning to program in windows and
>am having trouble getting windows not to erase the background to black before 
>reploting icons in a 7x7 grid i have. I have tried setbkmode (transparent)
>and setting hbackgnd to null for the window class of the grid window. neither
>of these seem to work! What am i doing wrong!?
>
I would guess one of two things.

Since you are using NULL for the background brush, you must
handle the WM_ERASEBKGND message.  Whether or not you
actually erase anything is totally up to you, but make sure
you return non-zero (and don't bother to call
DefWindowProc()).

If your "icons" are monochrome and you are using BitBlt() to
draw them, beware that the backgound color will be used for
white bits (1's), and foreground for black bits.  So you
might want to use SetBkColor() and SetTextColor() to get the
desired colors.

cheers - Paul Bonneau.
