scrolling MDIclients...

scrolling MDIclients...

Post by wh » Sun, 14 Oct 2001 00:10:18



I have an MDI form which contains many MDI child forms. When the user
scrolls the MDI client all the child forms move by default. What I need is
for *one* of these child forms to appear to stay in the same position all
the time.

The way I have gone about it is to subclass the MDI client's window
procedure. Inside the procedure I test for WM_HSCROLL and WM_VSCROLL and
adjust the Left and Top properties of the form I want to appear static. An
example (in Delphi) that I have is as follows:

    procedure TMainForm.ClientWndProc( var Message: TMessage );
    begin
      with Message do
        case Msg of
          WM_HSCROLL:
              begin
                Result := CallWindowProc( m_PrevClientProc, ClientHandle,
Msg, wParam, lParam );
                m_frmWelcome.Left := WParamHi;

'm_frmWelcome' is the child form that I want to remain in the same place.

The problem is that this method seems to produce a rather 'jerky' action. I
have tried setting the 'Left' property before I call the MDI client's
original window procedure but I get what seems the same effect.

Any ideas?

Thankx,
Wayne.

 
 
 

scrolling MDIclients...

Post by Andy » Mon, 15 Oct 2001 01:52:42


I'm not positive as I haven't tried this, but I believe you should be able
to process the WM_MOVING message. Since this message is sent before the
window actually moves, you can determine if it should be moved or not before
it happens.   This should remove the jerkiness.  I've used this method to
prevent the user from moving mdi windows outside of certain areas, however,
I'm not sure this is sent as a result of a scroll.

Andy C.


Quote:> I have an MDI form which contains many MDI child forms. When the user
> scrolls the MDI client all the child forms move by default. What I need is
> for *one* of these child forms to appear to stay in the same position all
> the time.

> The way I have gone about it is to subclass the MDI client's window
> procedure. Inside the procedure I test for WM_HSCROLL and WM_VSCROLL and
> adjust the Left and Top properties of the form I want to appear static. An
> example (in Delphi) that I have is as follows:

>     procedure TMainForm.ClientWndProc( var Message: TMessage );
>     begin
>       with Message do
>         case Msg of
>           WM_HSCROLL:
>               begin
>                 Result := CallWindowProc( m_PrevClientProc, ClientHandle,
> Msg, wParam, lParam );
>                 m_frmWelcome.Left := WParamHi;

> 'm_frmWelcome' is the child form that I want to remain in the same place.

> The problem is that this method seems to produce a rather 'jerky' action.
I
> have tried setting the 'Left' property before I call the MDI client's
> original window procedure but I get what seems the same effect.

> Any ideas?

> Thankx,
> Wayne.


 
 
 

scrolling MDIclients...

Post by wh » Tue, 16 Oct 2001 18:07:01


I have tried this and found that WM_MOVING doesn't get called when the
window moves because the MDI client is scrolling.

Wayne.


> I'm not positive as I haven't tried this, but I believe you should be able
> to process the WM_MOVING message. Since this message is sent before the
> window actually moves, you can determine if it should be moved or not
before
> it happens.   This should remove the jerkiness.  I've used this method to
> prevent the user from moving mdi windows outside of certain areas,
however,
> I'm not sure this is sent as a result of a scroll.

> Andy C.



> > I have an MDI form which contains many MDI child forms. When the user
> > scrolls the MDI client all the child forms move by default. What I need
is
> > for *one* of these child forms to appear to stay in the same position
all
> > the time.

> > The way I have gone about it is to subclass the MDI client's window
> > procedure. Inside the procedure I test for WM_HSCROLL and WM_VSCROLL and
> > adjust the Left and Top properties of the form I want to appear static.
An
> > example (in Delphi) that I have is as follows:

> >     procedure TMainForm.ClientWndProc( var Message: TMessage );
> >     begin
> >       with Message do
> >         case Msg of
> >           WM_HSCROLL:
> >               begin
> >                 Result := CallWindowProc( m_PrevClientProc,
ClientHandle,
> > Msg, wParam, lParam );
> >                 m_frmWelcome.Left := WParamHi;

> > 'm_frmWelcome' is the child form that I want to remain in the same
place.

> > The problem is that this method seems to produce a rather 'jerky'
action.
> I
> > have tried setting the 'Left' property before I call the MDI client's
> > original window procedure but I get what seems the same effect.

> > Any ideas?

> > Thankx,
> > Wayne.

 
 
 

scrolling MDIclients...

Post by Vince C » Fri, 14 Dec 2001 22:27:54


Why not remove the non-moveable MDI child out of the MDI client and turn it
into a fixed layout window? If it's located in the MDI frame but NOT in the
MDI client (i.e. if its parent is the frame instead of he MDI client) you
won't be bothered by trapping scrolling messages aso.

Just set the window alignment to either top, left, right or bottom do the
same for the MDI client area and manage so that both do not overlap. You
also can stick a sliding splitter to automatically size both windows. There
are plenty of splitter examples on the Web (planetsourcecode,
VBAccelerator,...). Try one and tell us.

--

Vince C.


> I have tried this and found that WM_MOVING doesn't get called when the
> window moves because the MDI client is scrolling.

> Wayne.



> > I'm not positive as I haven't tried this, but I believe you should be
able
> > to process the WM_MOVING message. Since this message is sent before the
> > window actually moves, you can determine if it should be moved or not
> before
> > it happens.   This should remove the jerkiness.  I've used this method
to
> > prevent the user from moving mdi windows outside of certain areas,
> however,
> > I'm not sure this is sent as a result of a scroll.

> > Andy C.



> > > I have an MDI form which contains many MDI child forms. When the user
> > > scrolls the MDI client all the child forms move by default. What I
need
> is
> > > for *one* of these child forms to appear to stay in the same position
> all
> > > the time.

> > > The way I have gone about it is to subclass the MDI client's window
> > > procedure. Inside the procedure I test for WM_HSCROLL and WM_VSCROLL
and
> > > adjust the Left and Top properties of the form I want to appear
static.
> An
> > > example (in Delphi) that I have is as follows:

> > >     procedure TMainForm.ClientWndProc( var Message: TMessage );
> > >     begin
> > >       with Message do
> > >         case Msg of
> > >           WM_HSCROLL:
> > >               begin
> > >                 Result := CallWindowProc( m_PrevClientProc,
> ClientHandle,
> > > Msg, wParam, lParam );
> > >                 m_frmWelcome.Left := WParamHi;

> > > 'm_frmWelcome' is the child form that I want to remain in the same
> place.

> > > The problem is that this method seems to produce a rather 'jerky'
> action.
> > I
> > > have tried setting the 'Left' property before I call the MDI client's
> > > original window procedure but I get what seems the same effect.

> > > Any ideas?

> > > Thankx,
> > > Wayne.

 
 
 

1. Need help on MDICLIENT window scroll bar controls

Hi,
        I am trying to add scroll bar controls onto MDICLIENT window.
I am encountering problem in setting the scroll range and the scroll
button position. I realize that most of the scroll bar control
notification messages are processed by DefMDIClientProc. It seems however,
that I need determine when to show the scroll bar and the scroll button
initial position. I tried trapping WM_MOVE in the window procedure of a
MDICLIENT's child window, but it doesn't seem to work. I would appreciate
it if anyone has experience with this could provide me some guidelines on
using scroll bar controls on MDICLIENT window.
        Thankyou very much.

Regards,
Shiun.
PS. please email to me if possible.

27 November 1992.

2. compressing utility

3. how to replace the build in scroll bar with my own scroll bar control

4. NT4.0 Domain & W2K work stations

5. How to scroll a window with custom scroll bars?

6. Heaven's Gate

7. A scroll view without scrolling bar

8. Stumped by DNS problem, help!

9. How to scrolling the other scroll bar on the ohter APP

10. Scroll view, scrolled by how much?

11. Scroll Bars & partial win scroll

12. How to add vertical scroll bar in dialog and make it scroll?

13. TranslateAccelerator & MDICLIENT windows