Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Closing child windows from command button?

Posted on 1998-11-23
2
Medium Priority
?
301 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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: 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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

926 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