Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages
Started by Sergey Dzekunov
Tue, 04 Mar 2003 04:06
MDI with CommCtl32
Author: Sergey Dzekunov
Date: Tue, 04 Mar 2003 04:06
Date: Tue, 04 Mar 2003 04:06
26 lines
2218 bytes
2218 bytes
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. Where can I find the description of how to do it right using bare Windows functionality? By the way, what is the message number 0x003F ? It is not described in winuser.h, but I noticed it always preceded sizing events. With many thanks in advance, Sergey
Re: MDI with CommCtl32
Author: Holy Punk
Date: Tue, 04 Mar 2003 01:16
Date: Tue, 04 Mar 2003 01:16
37 lines
2635 bytes
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.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads