Kent Guest
|
Posted: Fri Apr 28, 2006 4:03 am Post subject: Deactivate MDI Child |
|
|
I have a MDI app where specific MDI childs are displayed when a
specific tab from a TTabSet is selected. For example, if Tab1 is
selected, its associated childs are displayed with this call:
ShowWindow(TheForm->Handle, SW_SHOW);
If Tab2 is next selected, Tab1's childs are hidden with this call:
ShowWindow(TheForm->Handle, SW_HIDE); and Tab2's childs are displayed
with ShowWindow(TheForm->Handle, SW_SHOW) as above.
When a tab is selected, I activate that tab's highest z-order child
window with this call:
SendMessage(ClientHandle, WM_MDIACTIVATE, (WPARAM) MDIChild->Handle,
0); Thus, this window becomes the new ActiveMDIChild.
If I delete (not hide) Tab2's childs, there are no visible MDI child
windows on screen and the former ActiveMDIChild's menu is "unmerged"
from the Application's main menu as no MDI child is activated/focused.
If I reselect Tab1, its MDI childs are displayed and the new
ActiveMDIChild's menu is merged back in.
The problem is when I then reselect Tab2 and it contains no windows.
Although Tab1's windows are hidden, it still contains the
ActiveMDIChild and the main menu remains merged with the invisible
child's menu. I can't find a way to deactivate this hidden child to
force the main menu to unmerge.
Could someone offer some ideas on how to accomplish this?
Thanks,
Kent |
|