by2492
04-15-2003, 10:30 AM
i have a MDIForm, with some MDIChild's, and a ToolBar on the MDIForm with one Button.
in order to avoid putting code in all child, i decide to subclass each MDIChild.
so, what i want to do is: if one of the child is activate, the button on the MDIForm will be Enable, otherwise the button will be disable.
so, in the subclass i catch the WM_CHILDACTIVATE, and enable this button, also i catch the WM_DESTROY, and disable the button.
the problem is that the WM_CHILDACTIVATE occur before the WM_DESTROY, and the button is stay disable.
in order to avoid putting code in all child, i decide to subclass each MDIChild.
so, what i want to do is: if one of the child is activate, the button on the MDIForm will be Enable, otherwise the button will be disable.
so, in the subclass i catch the WM_CHILDACTIVATE, and enable this button, also i catch the WM_DESTROY, and disable the button.
the problem is that the WM_CHILDACTIVATE occur before the WM_DESTROY, and the button is stay disable.