msgs12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WM_ERASEBACKGROUND (1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINFRAMEMGR
 
WM_ERASEBACKGROUND
hps = (HPS) LONGFROMMP(mp1);           /* presentation-space handle  */
prectl = (PRECTL) PVOIDFROMMP(mp2);    /* address of RECTL structure */
 
The WM_ERASEBACKGROUND message is sent by the frame window to a client
window when the background is to be redrawn. Usually, an application ignores
this message and erases and redraws the window when the WM_PAINT message is
received. However, the WM_ERASEBACKGROUND message can be valuable in
improving the speed of window rearrangement operations by making the window
images consistent on the screen as soon as the rearrangement takes place.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Low and high word of mp1. Identifies a presentation space for the
           frame window (not the client window).
 
prectl     Low and high word of mp2. Points to a RECTL structure that
           contains the rectangle to be painted.
 
Return Value
 
If an application returns TRUE, the frame-window procedure erases the
rectangle of the frame window covered by the client window by filling it
with the system color SYSCLR_WINDOW. An application should return FALSE to
prevent the frame window from erasing the background.
 
Comments
 
The client window may use the presentation-space handle to selectively erase
portions of its window, and then return FALSE so that the frame window
procedure does not erase the background.
 
Note that the presentation-space handle is to the frame window, not to the
client window. The rectangle to be erased may include areas outside the
client window.
 
An application should not rely on the WM_ERASEBACKGROUND message for
notification as to when to repaint an invalidated client window. The
WM_ERASEBACKGROUND message is sent by the frame-window procedure as part of
processing the WM_PAINT message. However, if only the client window has been
invalidated, the client window does not receive a WM_ERASEBACKGROUND message
and the frame window does not receive the WM_PAINT message. An application
can monitor successive WM_ERASEBACKGROUND and WM_PAINT messages by using a
flag, and then only erase the background when processing WM_PAINT messages
if there is not an immediately preceding WM_ERASEBACKGROUND message.
 
 
                                      ♦