Solved

Closing all windows

Posted on 1998-11-18
3
163 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 103
Add content to output file 4 63
centeredAverage challenge 8 159
zeroFront challenge 7 94
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

816 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

8 Experts available now in Live!

Get 1:1 Help Now