Solved

How to eliminate Flickering when using ShowWindow()

Posted on 2000-03-09
1
883 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 50 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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