Solved

Closing child windows from command button?

Posted on 1998-11-23
2
287 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 100 total points
ID: 1325189
PostMessage( WM_CLOSE );
pMyView2->PostMessage( WM_CLOSE );

Phillip
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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