Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!sun-barr!newstop!sun!plx!johnc From: johnc@plx.UUCP (John C.) Newsgroups: comp.windows.ms Subject: Re: Large dialog boxes eating memory (use CS_SAVEBITS) Summary: CS_SAVEBITS Keywords: CS_SAVEBITS Message-ID: <2111@plx.UUCP> Date: 29 Nov 89 01:47:35 GMT References: <40130007@hpindda.HP.COM> <1989Nov27.132326.1158@chinet.chi.il.us> Reply-To: johnc@plx.UUCP (John C.) Organization: Plexus Software, Santa Clara, CA Lines: 29 >>I'm having problems with creating a big dialog box. If I create a big enough >>dialog box, when the box is displayed, most of my conventional memory is >>eaten up. I have no controls inside the box. As soon as the dialog box >>is moved, the conventional memory comes back to normal. If there is enough global memory available to do so, Windows will save the screen contents being obscured by the dialog so it can quickly redisplay them when the dialog is closed. This is controlled by the CS_SAVEBITS class style in the DIALOG class structure. You can disable the "savebits" behavior for the dialog you're opening by clearing the CS_SAVEBITS bit in the dialog's class style, as follows. Do this in the WM_INITDIALOG case of your dialog function, before the dialog becomes visible. Note that since this is a *class* style ("CS_") rather than a window style ("WS_"), this will affect *all* dialogs in the application, and I believe, all dialogs in the Windows session. /* Disable Windows "save dialog background" behavior */ int nDlgClassStyle = GetClassWord( hwndDlg, GCW_STYLE ); SetClassWord( hwndDlg, GCW_STYLE, nDlgClassStyle & (~CS_SAVEBITS) ); [We had to do this in the runtime system of the Plexus XDP product, a 4GL development environment for Windows-based image database applications, because most of our customers are using letter-size (8.5"x11") image fields (controls) in their forms (dialogs). That's a lotta bits to save, and Windows immediately grinds to a crawl unless we turn off CS_SAVEBITS.] /John Ciccarelli