Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - MDI flicking’s problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI flicking’s problem

 Post Reply Post Reply
Author
Message
zhou_wz View Drop Down
Groupie
Groupie


Joined: 11 December 2003
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote zhou_wz Quote  Post ReplyReply Direct Link To This Post Topic: MDI flicking’s problem
    Posted: 26 January 2005 at 10:43pm

Why one flicking and the other non-flicking?
The flicker happens when you use this code to attach MDIClientWnd
m_MTIClientWnd.Attach(this);// disable group
and when ChildFrame is maximnum, and activated by Left Button Click on the tab to switch the tab, you can see the caption frame appears and disappears
In the samples of XTP, there are two different methods to solve the mdichild caption's flicking in MDI app.

method 1.Overload WindowProc to deal WM_NCPAINT, such as in demo: CommandBarsDesigner

LRESULT CChildFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
 if (message == WM_NCPAINT)
 {
  // prevent caption blinking
  return TRUE;
 }
 
 return CMDIChildWnd::WindowProc(message, wParam, lParam);
}

method 2.Modify  mdichild initial size in PreCreateWindow, such as in demo: DrawCli

BOOL CSplitFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 // make sure view is maximum size to eliminate
 // flicker when switching tabs.
 cs.x =
 cs.y = 0;
 
 cs.cx =
 cs.cy = 32767;
 
 // TODO: Modify the Window class or styles here by modifying
 //  the CREATESTRUCT cs

 if( !CMDIChildWnd::PreCreateWindow(cs) )
  return FALSE;
 
 return TRUE;
}


It seems that the two methods work well in each application
But I try to use method 1 in DrawCli instead of meathod 2, the DrawCli still flicks.
I check the MainFrm, ChildFrm, even Views.
There is no code can solve the flicker.
Why this happens when transplant method 1 to method 2?

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.