Solved

Closing all windows

Posted on 1998-11-18
3
160 Views
Last Modified: 2013-11-20
I am wrting an app using MFC in Microsoft Visual C++
My system is connected to an UPS unit sending a command to close windows when a power failure is detected (The DestroyWindow function is automatically activated).
It is working well when my main view is active.
But if a modal dialog box is open the system crashes.
I suppose that all ressources are not closed properly.
My question is :How from the main DestroyWindow function
can i close all opened modal dialog boxes ?

Best regards !!!



0
Comment
Question by:marcelcohen
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
shaig earned 50 total points
ID: 1324886
Never tried it ;-)

.but call:

pMainWnd->SendMessageToDescendants( WM_DESTROY );

I hope that it will work!
0
 

Author Comment

by:marcelcohen
ID: 1324887
I try ot and it did'nt help.

0
 
LVL 3

Expert Comment

by:shaig
ID: 1324888
Do you have to close all windows or to close the entire application?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

19 Experts available now in Live!

Get 1:1 Help Now