🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1668

Re: CS_SAVEBITS doesn't work?

#1668
From: Tom W. Brown
Date: Fri, 16 Oct 1992 21:58
38 lines
2603 bytes
In article <1992Oct16.024604.7120@emr1.emr.ca>, jagrant@emr1.emr.ca (John Grant) writes:
|> I have implemented a floating window that hangs around and shows the (x,y)
|> of the cursor as it moves around the screen. I create it as a child window 
|> with a height equal to the height of the caption area, so all you get is the
|> system menu handle and a caption area.  Each time I get WM_MOUSEMOVE, I
|> SetWindowText(hwndxy,"...").  It works great and is really tiny (1 line).
|> 
|> However, I am not getting the expected results using window class style 
|> CS_SAVEBITS.  I don't want movement of the floating (x,y) window to 
|> generate WM_PAINT for the client area underneath if I don't have to.  The
|> help says that if style is CS_SAVEBITS, then it will try to save the bitmap 
|> behind the window so it can restore it.  Presumably then it won't have to
|> send WM_PAINT to the client beneath it.  No such luck.  There is tons of
|> memory available and it sure enough saves bitmaps for popup dialog boxes
|> to restore quickly.  Why won't it do it for my tiny little window?

Two things come to mind:

1. I think I've seen this behavior when a CS_SAVEBITS window is moved.  The
   underlying area is quickly restored, but from then on all updates are
   normal speed.  It's as if the capture of the area underneath the window
   is only done once, at window creation time.

   This actually makes sense -- if a CS_SAVEBITS window tried to actually
   save the bits everytime it was moved what would happen if it moved so that
   it still partially overlaid its old position?

2. Could it be that only modal windows work with CS_SAVEBITS?  Since an
   application could be "modifying" the client area beneath a modeless
   window perhaps the system just assumes the worst case and sends a
   WM_PAINT.


----------------------------------------------------------------------------
Tom Brown               |  "Strange women, lying in ponds, distributing
PE Nelson Systems       |   swords is no basis for a system of government."
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID: <642@lax.lax.pe-nelson.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
References: <1992Oct16.024604.7120@emr1.emr.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: CS_SAVEBITS doesn't work?
Message-ID: <642@lax.lax.pe-nelson.com>
Date: 16 Oct 92 21:58:48 GMT
References: <1992Oct16.024604.7120@emr1.emr.ca>
Sender: news@lax.pe-nelson.com
Organization: PE-Nelson
Lines: 38