Re: Displaying Text
- From: "David Webber" <dave@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 7 Jul 2007 16:53:04 +0100
"David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:9eOji.3771$bz7.493@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.
I am getting very vague on this now, but some time ago I was having problems drawing the background of my CMainFrame in my MDI application. All I wanted was a user-selectable colour :-)
Anyway I remember it as being much more complicated than just CMainFrame::OnEraseBkgnd() and my source code for doing it now has a somewhat enigmatic reference to knowledge-base article
http://support.microsoft.com/kb/129471/EN-US/
I'd have to do some research to remember how the following works (or even why I did it!) but I offer it in case it is of some use. The upshot is that my CMainFrame has a member
CMyMdiClientWnd m_wndMDIClient;
This is a very simple class: in its entirety:
class CMyMdiClientWnd : public CWnd
{
DECLARE_DYNAMIC(CMyMdiClientWnd)
public:
CMyMdiClientWnd();
virtual ~CMyMdiClientWnd();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
DECLARE_MESSAGE_MAP()
};
The only non-trivial code in the class implementation is the OnEraseBkgnd() member which draws the background.
And within
CMainFrame::OnCreate()
there is the magic code
if( !m_wndMDIClient.SubclassWindow( m_hWndMDIClient ) )
{
TRACE( _T("Failed to subclass MDI client window\n") );
return -1;
}
I'm not actually drawing anything on top of the background, but I am drawing a gradient fill in the background and it all works very smoothly. I seem to remember that all of the above was necessary to make it do so!
Dave
--
David Webber
Author of 'Mozart the Music Processor'
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
.
- Follow-Ups:
- Re: Displaying Text
- From: David Ching
- Re: Displaying Text
- References:
- Displaying Text
- From: katz911
- Re: Displaying Text
- From: David Ching
- Re: Displaying Text
- From: katz911
- Re: Displaying Text
- From: Scott McPhillips [MVP]
- Re: Displaying Text
- From: David Ching
- Displaying Text
- Prev by Date: Re: SetCheck
- Next by Date: Re: WaitForSingleObject() will not deadlock
- Previous by thread: Re: Displaying Text
- Next by thread: Re: Displaying Text
- Index(es):
Relevant Pages
|