Microsoft Foundation Classes (mfc.hlp) (Table of Contents; 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.
CWnd::OnEraseBkgnd
CWnd                                        Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  afx_msg BOOL OnEraseBkgnd( CDC*  pDC  );
 
  Parameter   Description
 
  <pDC>       Specifies the device-context object.
 
  Remarks
 
  Called when the CWnd background needs erasing (for example, when
  resized). It is called to prepare an invalidated region for painting.
 
  This message-handler member function calls the Default member
  function. Override this member function in your derived class to handle
  the WM_ERASEBKGND message.
 
  The Default and DefWindowProc member functions erase the background
  using the class background brush specified by the hbrbackground member
  of the class structure.
 
  If the hbrbackground member is NULL, OnEraseBkgnd should erase the
  background color. OnEraseBkgnd should align the origin of the intended
  brush with the CWnd coordinates by first calling the UnrealizeObject
  Windows function for the brush, and then selecting the brush.
 
  Windows assumes the background should be computed by using the MM_TEXT
  mapping mode. If the device context is using any other mapping mode, the
  area erased may not be within the visible part of the client area.
 
  Return Value
 
  OnEraseBkgnd should return TRUE to erase the background; otherwise, it
  should return FALSE.
 
  See Also
 
  ::UnrealizeObject, WM_ICONERASEBKGND, CWnd::Default,
  WM_ERASEBKGND, CBrush::FromHandle
 
 
                                     -♦-