[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to close all open dialogs programmatically?

Posted on 2001-07-02
4
Medium Priority
?
482 Views
Last Modified: 2013-11-20
In an application, on click of a particular menu option
1. All the dialogs that are opened should be closed  
   automatically.
2. There can be n number of dialogs open.
3. The open dialogs may me modal or modless.

How do I programmatically close all the open dialogs without exiting from the application?

0
Comment
Question by:pratimag
  • 2
4 Comments
 
LVL 2

Expert Comment

by:MadYugoslav
ID: 6247482
The easy way is to track and remember somewhere all windows when create new one.
The other solution is to go through all child windows of your main window and check is it non child window and then You close it.
0
 

Author Comment

by:pratimag
ID: 6247522
The question I asked was totally different. To close all the open windows or documents or child windows there is a api function called CloseAllDocuments(). You can just call this function.

What I asked was, how to close the open DIALOGS and not any child windows.
Any clue to this prolem is also welcome.
0
 
LVL 2

Expert Comment

by:MadYugoslav
ID: 6247543
Can You describe is it Dialog/MDI or SDI application ?
0
 
LVL 2

Accepted Solution

by:
GloriousRain earned 300 total points
ID: 6247551
I have 2 propose solutions for that:
1. Store every handle of opened dialog to an array. Whenever you want to close them, just call ::EndDialog(arrHandles[i], 1)
2. Create specific message then broadcast it when you want to close all dialog. In each dialog that you open have to process this message to exit itself.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

834 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