🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: MDI with CommCtl32

#17734
From: Holy Punk
Date: Tue, 04 Mar 2003 01:16
37 lines
2635 bytes
"Sergey Dzekunov" <si@sprintmail.com> wrote in message
news:3e642418$1@newsgroups.borland.com...
> I am using a command line compiler to build an MDI application with a
> toolbar. Common controls library works fine with single-document
> applications, but there is a problem in MDI: the client window overlaps
with
> the library's ToolBar and the StatusBar (obviously, they are all equal
> children of the same frame window). From my experience with OWL I recall
> that some explicit measures must be taken to adjust
> MDI's client window size, that's what TDecoratedFrame is basically doing.
> However, it was too troublesome for me to trace this class' hierarchy all
> the way up and find the code that's taking care about positioning and
sizing
> of the client window.

> I tried to subclass the MDIClient window to gain access to it's message
> loop. Then I started interfering with the WM_NCCALCSIZE message (which is
a
> rather complex one, and apparently it's description in win32.hlp contains
> errors). Almost by accident it all worked, but instead of celebrating I
was
> still sure there was a standard (read: "safe") method for such a common
> task. Just "it works" isn't good enough for me.


DefFrameProc( ... ) WinAPI is responsible for resizing MDI client window in
response to
the MDI frame window's WM_SIZE message. Simply, resize MDI client in your
handler of
WM_SIZE and do not call DefFrameProc(...) afterwards.

Of course, you can subclass MDI client. It's perfectly safe way of
introducing custom behavior.
However for such simple task, solution above is enough.

Best regards,
Holy Punk.
Technical Details
Message-ID: <3e64288a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e642418$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,c789f6650d6b8561
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-03-04 12:48:06 PST
From: "Holy Punk" <Holy_Punk@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e642418$1@newsgroups.borland.com>
Subject: Re: MDI with CommCtl32
Date: Mon, 3 Mar 2003 20:16:11 -0500
Lines: 39
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: 142.58.249.209
Message-ID: <3e64288a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1046751370 142.58.249.209 (3 Mar 2003 20:16:10 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail