From: kbrooks@ut-emx.uucp (kevin brooks)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: MDI status lines in TPW - what's wrong with code ?!
Summary: overload frame's WM_SIZE
Date: 12 Oct 92 19:30:24 GMT
Organization: The University of Texas at Austin, Austin, Texas

In article <1992Oct3.114139.7928@ac.dal.ca>, mctate@ac.dal.ca writes:
 > 
 > Hi folks,
 > 
 > I am trying to add a status line to an MDI app. that I am writing in TPW.
 > Thanks to help from a previous posting, I decided to subclass the TMDIWindow.
 > InitClientWindow method to resize the MDIClient window relative to the 
 > borders of the frame window, therefore making room for my status line. I 
 > wrote the following:
 > 
 > PROCEDURE TTestMDI.InitClientWindow;
 >   var MDIClient : TRect;
 > 
 >   BEGIN
 >      TMDIWindow.InitClientWindow;
 >      
 >      {get the client window's coords. into a TRect}
 >      GetClientRect(ClientWnd^.HWindow, MDIClient);
 > 
 >      {resize the client window by 10 units at bottom to accomodate
 >      the status line}
 >      SetWindowPos(ClientWnd^.HWindow, 0, MDIClient.left, MDIClient.top,
 >        MDIClient.right, MDIClient.bottom - 10, SWP_NOZORDER);
 > 
 >      {add scrollers to the resized client window}
 > 
 >     WITH ClientWnd^.Attr DO
 >       Style := Style or WS_VScroll or WS_HScroll;
 >   END;
 > 
 > However, the scrollers always occupy the edges of the frame window
 > leaving no room for my status line at the bottom, so I'm probably doing
> something really stupid. I have also tried substituting the SetWindowPos
> call with the following:
>   
>      MoveWindow(ClientWnd^.HWindow, MDIClient.left, MDIClient.top, 
>       MDIClient.right, MDIClient.bottom - 10, True);

This is a the function you should use, but, in your frame  
window, try simply overloading the frame's WMSize (MYTFrameWindow::WMSize in Borland C++).  In this function, first call the DefWndProc, then use you MoveWindowcode.  This insures that the client is resized to your specifications every time the frame window is resized.  Also, remember that the status bar window should not have its MDICHILD flag set.

Regards,

Kevin

KBROOKS@EMX.UTEXAS.EDU

> Marcus Tate.
> Grad. student. (mctate@ac.dal.ca).

, in your frame 
                                                        .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
 
                                                 
                                                     
                                                     
                                                           
                                              
                                                       
                                                   
                                                  
                                                      
                                                          
                                                       
                                                       
                                                     
                                              
                                                         
                                                   
                                           
                                        
                    

Newsgroups: comp.os.ms-windows.programmer.misc