🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

bg color for window instances

#258
From: Rich Johns
Date: Thu, 09 Apr 1992 16:27
21 lines
1003 bytes
A while back I had asked how to paint the background color of individual
instances of a window class. I've got a solution. Since a number of people 
sent me mail asking me to post results, here goes.

There are probably multiple ways to skin this cat but here is the
solution that works for me. Thanks to Niels Erik Holm, who gave it to me.

some where you initialize hBgBrush:

HBRUSH hBgBrush = CreateSolidBrush( RGB( 0, 0, 255 ) );  // ie., blue brush

then in your window proc:

case WM_ERASEBKGND:
   {
   RECT clipRect;
   GetClipBox( (HDC)wParam, &clipRect );
   FillRect( (HDC)wParam, &clipRect, hBgBrush );
   return ( (LONG)TRUE );
   }
   break;
Technical Details
Message-ID: <1992Apr9.162759.13185@borland.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!borland.com!rpj

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!borland.com!rpj
From: rpj@borland.com (Rich Johns)
Subject: bg color for window instances
Message-ID: <1992Apr9.162759.13185@borland.com>
Organization: Borland International
Distribution: comp.windows.ms.programmer
Date: Thu, 9 Apr 1992 16:27:59 GMT