Re: Displaying Text



"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:pMidnTh4DdU6DxLbnZ2dnUVZ_oesnZ2d@xxxxxxxxxxxxxx
The reason for the flickering is that the WM_ERASEBKGND message is sent
just prior to WM_PAINT. The default MFC message handler makes the window
all white in WM_ERASEBKGND, and this is briefly visible.

When you use a memory DC you suppress the MFC erase by overriding
WM_ERASEBKGND and doing nothing, then you combine the erase and text paint
into a single visual change.


It's always bothered me that when I resize my main window, all the controls
within it flicker, including the toolbar and view areas. I believe there's
some sort of CS_ style that could stop this, something like CS_CLIPCHILDREN,
or even overriding CMainFrame::OnEraseBackground() to do nothing, as you
say. Do you know of any way of stopping this? I just haven't had time to
research it.

Thanks,
David


.



Relevant Pages

  • Re: Displaying Text
    ... button is pressed and the window size is being changed. ... But the CMainFrame's client area is entirely covered by the CView derived class in application's that have a CView. ... The default MFC message handler makes the window all white in WM_ERASEBKGND, ... When you use a memory DC you suppress the MFC erase by overriding WM_ERASEBKGND and doing nothing, then you combine the erase and text paint into a single visual change. ...
    (microsoft.public.vc.mfc)
  • Re: VMR-9 issues with IVMRWindowlessControl9::RepaintVideo
    ... Are you also overriding WM_ERASEBKGND to do a no-op for the window that ... screen-flickering. ... still don't understand why the SetBorderColormakes my whole video ... window black somtimes... ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: How to hide form from Alt-Tab dialog
    ... You need to change the style of your Window. ... You can do this by overriding ... the CreateParams property of your form. ... The following should do the trick: ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Updating MinimumSize while resizing does not work ?
    ... I tried overriding the WM_GETMINMAXINFO in WndProc, ... My resize logic is a bit strange in that you'd normally expect the ... contents of a window to have a predictive minimum size. ... But we could do it in the overridden WndProc method. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Preventing a Docked window from closing or knowing when it is...
    ... you might consider monitoring for the event and then overriding or just redrawing the window. ... "Dewi Bygrave" wrote in message ...
    (microsoft.public.visio.developer.vba)

Loading