Re: win32lib scrollbar bugs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Don wrote:
> > to Derek Parnell (and others)
> >
> > Win32lib seems to have a problem with scrollbars that have long
> > ranges.  I have included a small test program which exposes this
> > bug.  When the scroll range is set to anything over 65535, win32lib
> > won't let you use the whole scrollbar.  Try this for yourself to
> > see what I mean.  You can still use the arrows to scroll past
> > 65535, but if you drag the scrollbar and watch the number under it,
> > you'll notice that they skip back to 0.
>
> This behaviour is not related to Win32Lib or any bug...
>
> Microsoft (in their infinite wisdom) decided the messages that indicate
> scroll bar position, WM_HSCROLL and WM_VSCROLL, are limited to 16 bits
> of position data (65535 max).  I am not aware of any reliable work
> around apart from creating a custom scroll bar control.

>From win32 reference:

Note that the WM_VSCROLL message carries only 16 bits of scroll box position
data. Thus,
applications that rely solely on WM_VSCROLL (and WM_HSCROLL) for scroll position
data have
a practical maximum position value of 65,535.

However, because the SetScrollPos, SetScrollRange, GetScrollPos, and
GetScrollRange
functions support 32-bit scroll bar position data, there is a way to circumvent
the 16-bit
barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollPos for a
description of
the technique and its limits.

    Martin

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu