Retrieve Scrollbar Delays

Windows specific forum
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Retrieve Scrollbar Delays

Post 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
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Would it perhaps be the same as #SPI_GETKEYBOARDDELAY returned by SystemParametersInfo_() ?
I may look like a mule, but I'm not a complete ass.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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).
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I've looked high and low and found nothing that helps you Fluid Byte. :(
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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. :)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I was hoping for something like UDM_GETACCEL and UDM_SETACCEL which are used for Up Down Controls, but no such luck.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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?
bye,
Daniel
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Hooked timer moves scrollbar every 30 ms. Seems pretty accurate from here.
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post 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. :)
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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!

:)
I may look like a mule, but I'm not a complete ass.
Post Reply