0
votes

How to handle messages of sub window in MFC. I created a menu and when I'm clicking the menu, the program creates a dialog window.

How do I close the menu window when its dialog window is closed?

1
Can you be more clear as to what exactly you are looking for? - ckv
In particular, what class is the menu? What message are you responding to when creating the dialog? Is the dialog modal? - Aidan Ryan
my quest. is how to close the parent window when we are closing child window . - sun

1 Answers

0
votes

If dialog is modal:

Close the parent window after returning from DoModal;

You don't return from DoModal until the dialog is closed.

If dialog is not modal:

When you initialize the dialog, send a pointer of the parent to the dialog.

Close the parent using the pointer, where you capture the dialog close event.