Solved

How to eliminate Flickering when using ShowWindow()

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now