[comp.windows.ms] Solved: the CS_SAVEBITS mystery

brent@well.UUCP (Brent Southard) (12/01/88)

Here is an explanation of the CS_SAVEBITS flag, courtesy of Microsoft
Technical Support...

Question:

Page 634 of the "Microsoft Windows Software Development Kit
Programmer's Reference" states that there is a "style" type of
CS_SAVEBITS defined. If I set this style, does this mean I do not have
to maintain my own off-screen bitmap? How do I access the bitmap that
is saved?

Response:

The documentation is slightly misleading as it is currently worded. If
the CS_SAVEBITS style is included when registering a POPUP window, a
bitmap copy of the screen image that the window will obscure is saved
in memory when a window is displayed.

The bitmap will be redisplayed at its original location and no
WM_PAINT messages will be sent to the obscuring windows if the
following is true when the window is removed from the display:

1. The memory used by the saved bitmap has not been discarded.

2. Other screen actions have not invalidated the image that it is
   storing.

As a general rule, you should not set this bit if your window will
cover more than half the screen; a lot of memory is required to store
color bitmaps.

The window will take longer to be displayed because memory needs to be
allocated. The bitmap also needs to be copied over each time the
window is shown.

Use should be restricted to small windows that come up and are then
removed before much other screen activity takes place. Any memory
calls that will discard all discardable memory, and any actions that
take place "under" the window, will invalidate the bitmap.

-----

I believe the above is probably owned by Microsoft, so be careful what you
do with it.  :)

-- 
Brent Southard                    |  Everybody's trying to be a friend of mine,
Usenet:  ...well!brent            |  Even a dog can shake hands. - W. Zevon
   CIS:  76657,415                |  We fell into love, love's a very deep hole.
 GEnie:  b.southard               |                      - Loudon Wainwright III