CoderSource.net
Search
Re: Close all Child window
Started by agenore at 05-26-2006 3:40 AM. Topic has 7 replies.

Print Search « Previous Thread Next Thread »
   05-26-2006, 3:40 AM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Hmm [^o)] Close all Child window
Hi,
Is it possible close all the windows child in a MDI application?



   Report 
   05-27-2006, 10:33 AM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Close all Child window

Hi agenore,

When do you want to close all the windows, they all close when the program is terminated anyway. What type of event are you using to close the windows

Peter


   Report 
   05-28-2006, 5:00 AM
Yasir is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Close all Child window
off course you can close all the windows of child frames. but you have to write that in the Mdiframewnd. However it depends on which event you want to do it
   Report 
   05-29-2006, 12:24 AM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Re: Close all Child window
I've written a little application that use a DB connection. I can change the db when I want inside the application. Now, when I do it I must close all the windows child which use a db connection (not necessary all windows).


   Report 
   05-30-2006, 2:13 PM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Close all Child window

How are you child windows coded?  Has each child window it's own class? If so, write a public function in each class that sends the WM_CLOSE message or calls "this->DestroyWindow()" when it's called.  When you declare instances of the child windows, the pointers must be available to an event handler that can call all the close functions in one event.

Just an idea.  Huh? [:^)]

Peter


   Report 
   05-30-2006, 2:19 PM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Close all Child window

Add to my last post on reflection.  If you have pointers to the child windows all you have to do is call:    myChildWindow->DestroyWindow();  in the event handler.    Embarrassed [:$]

Peter


   Report 
   06-28-2006, 1:26 AM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Re: Close all Child window
Hi,
Sorry, but I read the forum only now.
Well... I've had the pointers of the child windows (I suppose) because they are open, but where they are I don't know. If I have 3 child open in a MDI structure, how can I obtain the pointers?
Thanks.

   Report 
   06-28-2006, 12:41 PM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Close all Child window

Hi agenore,

Does each child window have it's own class, and if so, then what class are they derived from?

Regards

Peter


   Report 
Codersource.Net » Programming » MFC Programming » Re: Close all Child window

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us