Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to eliminate Flickering when using ShowWindow()

Posted on 2000-03-09
1
Medium Priority
?
939 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
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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‚Ķ
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Integration Management Part 2

916 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