Solved

Closing child windows from command button?

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

Phillip
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 371
tripleUp challenge 7 73
scoreUp challenge 14 56
Annoying "thing" blocks my view 4 80
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

943 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

10 Experts available now in Live!

Get 1:1 Help Now