Re: Scrolling window with child controls

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: vipin (vipin_at_nospam.com)
Date: 05/10/04


Date: Mon, 10 May 2004 19:39:54 +0530


Hello,
      Yes, MoveWindow with also works as expected but there is a problem
because I have to cache the control positions when I do a createwindow and
then move them relatively up or down the current thumb position. There looks
to be no api which will return the positions passed to CreateWindow at
runtime. GetclientRect(...) doesn't give me absolute position. There
appears no api to give the absolute postion.

If you speculate any issues I am going to fall into with this approach
please let me know the issues.I would make the changes to MoveWindow in
future though,looks like the better way out,though not for the time being.

thanks in advance.
vipin
"Gary Chanson" <gchanson@No.Spam.TheWorld.net> wrote in message
news:#VnTiJnNEHA.3572@tk2msftngp13.phx.gbl...
>
> "vipin" <vipin@nospam.com> wrote in message
> news:uTZhbnmNEHA.1956@TK2MSFTNGP10.phx.gbl...
> >
> > Hello,
> > I am not sure if there is a better way of implementing scroll for
a
> > window which has child control windows.
> >
> > The following is the sequence, I use to have the scrolls implemented
> > properly:-
> >
> >
> > WM_SIZE:
> >
> > DestroyWindows(...) // destroy previous child controls on the top level
> > window
> >
> > PostionWindows(...) // Use CreateWindow and then place the child
controls
> > in the main window. This means create control windows each time and
place
> > againon the client window,each time user resizes.
> >
> > SetScrollInfo(...) // Set the scroll range(maximum,page,etc)
> >
> >
> > I am aware of implementing the scroll if the window has some graphic
> > objects, in which case I can write the section of graphics objects into
> the
> > HDC in the WM_PAINT message. But I am not sure if the above approach is
> the
> > recommended way of having the scrolls implemented when controls are on
the
> > client window.
>
> Why don't you just move the controls to the position you're currently
> using for the new controls?
>
> --
> -GJC [MS Windows SDK MVP]
> -Software Consultant (Embedded systems and Real Time Controls)
> - http://www.mvps.org/ArcaneIncantations/consulting.htm
> -gchanson@mvps.org
>



Relevant Pages

  • The window does not have scroll bars..
    ... The window does not have scroll bars.. ... 00442d8c pveterin.exe Graphics 2524 GDIError ... 004671dc pveterin.exe Controls 7039 TWinControl.HandleNeeded ...
    (alt.comp.lang.borland-delphi)
  • Re: New Combobox disabled
    ... You're right that CreateWindow wasnt needed. ... By main window, do you mean the Word Application window? ... the UserForm is where the combobox needs to reside. ... All my controls are placed on a MultiPage on the ...
    (microsoft.public.vb.winapi)
  • Re: 3rd Party ActiveX Form Control...
    ... Go the api route. ... a window, more CreateWindow calls to add the controls. ...
    (microsoft.public.vb.general.discussion)
  • Re: Error creating window handle
    ... i did not use any controls to draw them at all. ... a window has to be poped up to display information. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Error creating window handle
    ... i did not use any controls to draw them at all. ... a window has to be poped up to display information. ...
    (microsoft.public.dotnet.framework)