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
Solved

how to close all open dialogs programmatically?

Posted on 2001-07-02
4
419 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 100 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 49
fizzArray2 challenge 1 90
noX challenge 17 129
Problem to event 3 102
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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 …
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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