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.