🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #169

Re: Setting BackGround Color of a window

#169
From: DanC
Date: Mon, 06 Apr 1992 13:45
26 lines
1478 bytes
This might be useful to general readers so I am posting it.

In article <1992Apr3.172057.29585@borland.com> rpj@borland.com (Rich Johns) writes:

>Does anybody out there have a window class in which each instance
>of that class can have a different background color? I just can't believe
>such  a thing can be so hard. I mean, its easy to change the bg for the
>entire class, but how can it be done on an instance basis?

Create the window class with a NULL brush, ie;

WNDCLASS wndclass;

...

wndclass.hbrBackground = NULL;

Then trap the WM_PAINTBKGND message and paint the background using
one of the rectangular fill procedures.

--------------------------------------------------------------------------
Dennis Chuah  | "Pencangkul Matahari"  email:   
EEE Canterbury|  chuah@stargate.elec.canterbury.ac.nz  (SUN) <- preffered
New Zealand   |  CHUAHDC@ELEC.canterbury.ac.nz         (VAX)
---------------- CHUAH-DC@opheus.elec.canterbury.ac.nz (NOVELL) ----------
(bugs+flames) > /dev/null
Technical Details
Message-ID: <1992Apr7.014515.4551@csc.canterbury.ac.nz>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!canterbury.ac.nz!antares.elec!chuah

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!canterbury.ac.nz!antares.elec!chuah
Newsgroups: comp.windows.ms.programmer
Subject: Re: Setting BackGround Color of a window
Message-ID: <1992Apr7.014515.4551@csc.canterbury.ac.nz>
From: chuah@elec.canterbury.ac.nz (DanC)
Date: 7 Apr 92 01:45:14 +1200
Organization: Electronic and Electrical Engineering Department, University of Canterbury, New Zealand.
Nntp-Posting-Host: 132.181.50.15
Lines: 26