Print Page | Close Window

MDI flicking’s problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1707
Printed Date: 07 November 2025 at 6:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI flicking’s problem
Posted By: zhou_wz
Subject: MDI flicking’s problem
Date 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?




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net