?
Solved

How to eliminate Flickering when using ShowWindow()

Posted on 2000-03-09
1
Medium Priority
?
915 Views
Last Modified: 2013-11-20
hi

  I want to show a series of dialog boxes. I use ShowWindow, but i notice flickering and slow refreshing ( coz i'm able to see background applications when the refreshing occurs )

eg from Dialog Box 1 to Dialog Box 2

   ShowWindow(SW_HIDE);
   Dlg2.DoModal();
   ShowWindow(SW_SHOW);

   Any suggestions the above code i used or other methods greatly appreciated. TIA!
0
Comment
Question by:kc76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
mahno earned 150 total points
ID: 2603856
U can increase speed by following way:

Add to class for Dlg2:

class CClassName : public CDialog {
  //add class member
  CDialog *m_pParentDlg;  
  //...
  //add metdod
  void SetParentDlg(CDialog *pParentDlg);
}

//...

//Add string to constructor
void CClassName::CClassName() {
  //...
  //Initialize m_pParentDlg
  m_pParentDlg = NULL;
}

void CClassName::SetParentDlg(CDialog *pParentDlg) {
  m_pParentDlg = pParentDlg;
}

void CClassName::OnShowWindow(BOOL bShow, UINT nStatus) {
      CDialog::OnShowWindow(bShow, nStatus);
      
  if ((bShow == TRUE) && (m_pParentDlg != NULL))
    m_pParentDlg ->ShowWindow(SW_HIDE);
}

//Add this for OnClose, OnOk, etc.
void CClassName::OnClose() {
  //...
  if (m_pParentDlg != NULL)
    m_pParentDlg ->ShowWindow(SW_SHOW);
}


Hope this helps,
  mahno
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question