Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - the view is drawed twinkling
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

the view is drawed twinkling

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


Joined: 22 April 2004
Status: Offline
Points: 95
Post Options Post Options   Thanks (0) Thanks(0)   Quote freehawk Quote  Post ReplyReply Direct Link To This Post Topic: the view is drawed twinkling
    Posted: 10 March 2005 at 8:17pm

Hello

There are tabbed MDI client windows which can be changed to Max, Min or normal size. After maximized one window, and then switched among client windows by clicked the title tabs, the view is drawed twinkling and not smooth. Please help me how to resolve it?

Thanks.

Freehawk

Back to Top
proe View Drop Down
Newbie
Newbie


Joined: 17 June 2005
Location: China
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote proe Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2005 at 3:38am

BOOL CChildFrame::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;

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

 return TRUE;
}

Back to Top
pascal View Drop Down
Groupie
Groupie


Joined: 07 February 2005
Location: Germany
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote pascal Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2005 at 2:47pm

Hello,

the best way to avoid fleeking is to inherit from CXTPTabClientWnd and to catch the WM_MDIACTIVATE message. You should then lock the redraw before calling the base class and unlock it after execution.  See code below.

best regards from Göttingen, germany

BEGIN_MESSAGE_MAP(CMainTabClientWnd, CXTPTabClientWnd)ON_WM_MDIACTIVATE()
END_MESSAGE_MAP()

void CMainTabClientWnd::OnMDIActivate(BOOL bActivate,CWnd* pActivateWnd, CWnd* pDeactivateWnd)
{
SetRedraw(FALSE);
CWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);
SetRedraw(TRUE);

RedrawWindow( NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
}

Pascal Verdier
Software Engineer Manager
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.