Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

Closing child windows from command button?

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
GEE
Asked:
GEE
1 Solution
 
GEEAuthor Commented:
Edited text of question
0
 
psdavisCommented:
PostMessage( WM_CLOSE );
pMyView2->PostMessage( WM_CLOSE );

Phillip
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now