🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3696

Deactivate MDI Child

#3696
From: Kent
Date: Fri, 28 Apr 2006 03:14
32 lines
2225 bytes
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
Technical Details
Message-ID: <44518896@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6797d5d4dd4717b2,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kent" <kentav@accessus.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Deactivate MDI Child
Date: Thu, 27 Apr 2006 22:14:34 -0500
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.206.177.249
Message-ID: <44518896@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1146194070 207.206.177.249 (27 Apr 2006 20:14:30 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail