Page 1 of 2

Retrieve Scrollbar Delays

Posted: Sat Apr 04, 2009 1:50 pm
by Fluid Byte
I want to retrieve the delays for a system scrollbar. This means the delay for a first click (it in-/decreases the scrollbar value by 1 on the first click but waits a little before it starts continuous scrolling) and for continuous scrolling after the first click.

I'm still a little drunk and tired so don't feel like camping in the PSDK today.

Though I guess it must be buried in SystemParametersInfo_() somewhere ...

Image

Posted: Sat Apr 04, 2009 1:59 pm
by srod
Would it perhaps be the same as #SPI_GETKEYBOARDDELAY returned by SystemParametersInfo_() ?

Posted: Sat Apr 04, 2009 2:23 pm
by Fluid Byte
I just have put all keyboard delays to max but it doesn't effect the scrollbar timers at all.

And SystemParametersInfo_() is just guess, it may be a constant as well (like #MAX_PATH or something).

Posted: Sat Apr 04, 2009 3:38 pm
by Fluid Byte
I have figured out the value for the first click delay now. It's actually the DoubleClick time which is set in the "Mouse" control panel. Yeah, of course this is where you look first ... :roll:

Although there is a #SPI_SETDOUBLECLICKTIME message it seems the #SPI_GETxx counterpart is missing. But I have found out that there are separate functions for this: Set- / GetDoubleClickTime_()

Now I need to figure out the delay while doing continuous scrolling. I am 100% sure there is a delay otherwise it would run way too fast. I can tell because the reason I ask is that I'm currently creating a complete owner-draw scrollbar from scratch.

Posted: Mon Apr 06, 2009 2:42 am
by Sparkie
I've looked high and low and found nothing that helps you Fluid Byte. :(

Posted: Mon Apr 06, 2009 2:55 pm
by Fluid Byte
Hmmpf .... :x

Really seems to be a tuff nut. Like you said, it's hard to find any stuff at least mentioning the word "timer" or "delay" in conjunction with scrollbars. I abused Google with every possible search query but nothing ...

Well, I guess I have to use my own delay. Seems to be around 50-80ms for each scroll step. I just hate it to only have "rough" information.

Anyhow, thanks for trying sparks. :)

Posted: Mon Apr 06, 2009 3:06 pm
by Sparkie
I was hoping for something like UDM_GETACCEL and UDM_SETACCEL which are used for Up Down Controls, but no such luck.

Posted: Mon Apr 06, 2009 3:12 pm
by DarkDragon
Well maybe the delay for scrolling is constant. But I know you can set the lines which will be scrolled in the mousewheel-options. Maybe thats the missing hint?

Posted: Mon Apr 06, 2009 3:44 pm
by Fluid Byte
Sparkie wrote:I was hoping for something like UDM_GETACCEL and UDM_SETACCEL which are used for Up Down Controls, but no such luck.
It's frighting how we think alike. Kind of a DejaVu because I know I already said this in similar situation. :P

Yes, actually I was that "desperate" and looked there too yesterday. But a Windows system scrollbar doesn't seem to be constructed with UpDown controls but is completely "homebrewn".
DarkDragon wrote:Well maybe the delay for scrolling is constant.
Absolutely possible but where to look? I could poke around in "CommCtrl.h" which is located in the "include" folder of the PSDK. Though I don't think I will get any further with that.
DarkDragon wrote:But I know you can set the lines which will be scrolled in the mousewheel-options. Maybe thats the missing hint?
That is true but it's not related to the speed a scrollbar moves it shaft when clicking on one of the arrow buttons. When using the mousewheel the shaft will move as fast as you spin the wheel.

Posted: Wed Apr 08, 2009 12:55 am
by Sparkie
Fluid Byte wrote:It's frighting how we think alike.
Does that mean I have the mind of a youngster or you have the mind of an old fart :P :lol:

It would appear as if the scrollbars are controlled by a system timer with an ID that is always 65534. If I get time I'll try to catch that little shit in a hook and see if it'll spit out its delay time.

Posted: Wed Apr 08, 2009 11:30 am
by Fluid Byte
Sparkie wrote:Does that mean I have the mind of a youngster or you have the mind of an old fart :P :lol:
It's just means we are API junkies and like programing. :P

But crap, I'm getting older, time flies ... :?
Sparkie wrote:If I get time I'll try to catch that little shit in a hook and see if it'll spit out its delay time.
That's the spirit! Whack that sucker! :twisted:

Posted: Thu Apr 09, 2009 1:00 am
by Sparkie
Hooked timer moves scrollbar every 30 ms. Seems pretty accurate from here.

Posted: Thu Apr 09, 2009 1:47 am
by Fluid Byte
Hmmm, 30ms ...

I created a scrollbar with min=0, max=100 and pagelength=10 in PureBasic and (roughly) timed how long it takes to scroll from top to bottom compared to my custom scrollbar. It came around 45-50ms. Pretty close though. But it doesn't matter anyway since the difference is small and you can specify your own delay anyway. As a default I use 50ms for my scrollbar at the moment but I will use a compromise of 40ms now resulting from my experience and your research.

But lets face it. You don't do that for me but because you like the challenge. :wink:

Anyway, thanks for your insisting effort! It was a pleasure like always. :)

Posted: Fri Apr 10, 2009 12:14 am
by Sparkie
Fluid Byte wrote:But lets face it. You don't do that for me but because you like the challenge.
Not true...whenever I see the Bat signal, I fly into action, no matter who's at the other end of the light :P

Posted: Fri Apr 10, 2009 10:16 am
by srod
Sparkie wrote:
Fluid Byte wrote:But lets face it. You don't do that for me but because you like the challenge.
Not true...whenever I see the Bat signal, I fly into action, no matter who's at the other end of the light :P
Don't let KCC hear that as you'll never get any bat sleep!

:)