🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

CS_SAVEBITS (was Re: Preventing Windows from resizing windows)

#1262
From: Michael Roper
Date: Fri, 08 Feb 1991 13:49
36 lines
2145 bytes
Glenn Patrick Steffler writes:

> >  I would also be interested to know what exactly
> >setting a window's style to CS_SAVEBITS does.  It's supposed to save
> >the portion of the screen that is covered by another window and restore
> >that portion when the window becomes active again.  Alas, this does not
> >seem to happen...
> 
> I would think your application would know better how to manage the client
> updating better than windows.  i.e. keep a bitmap around for yourself, and
> make it discardable, so in low memory situations, the bitmap will
> disappear, but you could re-create it in such a case.  This is basically
> what windows does with the CS_SAVEBITS...notice the mention that it MAY
> NOT ALWAYS SAVE the BITS in low memory situations.

No, this is not what Windows does with CS_SAVEBITS.
CS_SAVEBITS has nothing to do with saving bitmaps
for the window created with that class style.  

Rather, if window A is a CS_SAVEBITS window and it
covers window B (which may or may not be a CS_SAVEBITS
window -- it's irrelevant), then the area of window
B obscured by window A is saved.  When window A is
subsequently removed, window B does not receive a 
WM_PAINT message -- Windows justs blits the saved
bitmap back where it belongs.

I'm not certain this is still true, but with versions
prior to 3.0, the saved bitmap was non-discardable
(believe it or not).

The most common example of a window that is CS_SAVEBITS
is the window Windows uses to display a drop-down menu.

Michael Roper
hDC Computer Corporation
Technical Details
Message-ID: <466@nwnexus.WA.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!milton!sumax!polari!thebes!happym!nwnexus!roper
References: <16477.27ade4f3@ul.ie> <1991Feb7.190951.7723@sunee.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!ubc-cs!uw-beaver!milton!sumax!polari!thebes!happym!nwnexus!roper
From: roper@nwnexus.WA.COM (Michael Roper)
Newsgroups: comp.windows.ms.programmer
Subject: CS_SAVEBITS (was Re: Preventing Windows from resizing windows)
Message-ID: <466@nwnexus.WA.COM>
Date: 8 Feb 91 13:49:24 GMT
References: <16477.27ade4f3@ul.ie> <1991Feb7.190951.7723@sunee.waterloo.edu>
Reply-To: roper@nwnexus.UUCP (Michael Roper)
Organization: hDC Computer Corporation, Redmond WA
Lines: 36