Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Closing child windows from command button?

Posted on 1998-11-23
2
Medium Priority
?
295 Views
Last Modified: 2013-11-20
In an MDI app with 3 child (CFormView) windows, how can I
close 2 specific child windows of the 3 with a single
command button on one of the forms?
PostMessage(WM_COMMAND, ID_FILE_CLOSE) closes all windows.

Please add sample code.  Thanks
It should look like this:

void CMyView1::OnButtonClick()
{
   "Close" CMyView1;  //current child window
   "Close" CMyView2;

   // Leave CMyView3 Open
}
0
Comment
Question by:GEE
[X]
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
2 Comments
 

Author Comment

by:GEE
ID: 1325188
Edited text of question
0
 
LVL 7

Accepted Solution

by:
psdavis earned 200 total points
ID: 1325189
PostMessage( WM_CLOSE );
pMyView2->PostMessage( WM_CLOSE );

Phillip
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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: 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 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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

705 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