News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Scrollbar repeat rate

Started by Jimg, October 26, 2007, 02:57:30 PM

Previous topic - Next topic

Jimg

I'm coding my own scrollbar.  Does anyone know how to get what windows normally uses for the repeat rate and delay for a scrollbar (e.g. when you hold a scroll button down)?

ramguru

Interesting, just few weeks ago I decided the same thing, to create my own scrollbars, because I wanted 64 bit support, I had to postpone the project though (university, master degree etc..) To answer your question, I will likely be using SetTimer for that purpose (or maybe won't invent this feature at all, it doesn't look like being of greatest importance).

Tedd

I wouldn't be surprised if the value was made up on the spot - "whatever looks good" is a great design metric :green2
More sensibly, how about basing it on the keyboard repeat rate?
No snowflake in an avalanche feels responsible.

Jimg

Ok, thanks guys.  I just thought there might be some GetScrollBarSystemParams api I didn't know about.

MichaelW

The attachment is a quick test app that measures the repeat delay and repeat rate. I didn't bother to automate it, so to use it you must basically depress one of the scroll bar buttons and hold it down until the results appear. The reset button does the obvious. On my Window 2000 SP4 system the values appear to be ~350ms and 20 repeats per second, and I could find no setting that would change this. It seems somewhat strange to me that as well-developed and customizable as Windows is, Microsoft would have failed to provide some obvious method of controlling these values.

[attachment deleted by admin]
eschew obfuscation

ramguru

Maybe this would make more sense:

invoke GetDoubleClickTime
shr eax, 1
invoke SetTimer, .., .., eax, ..

IMO it's reasonable to put 100ms in SetTimer (I just played a little and came to this conclusion :)).

Anyway, if Jimg were serious about this project. It wouldn't hurt to experiment with suggested values and pick the most appropriate one.

Jimg

Geez Michael, this is really above and beyond the call of duty.  Nice work :U

Before I tried this myself, I just thought I'd ask if anyone knew an api to get the info from Windows itself.

Maybe I'll make it user setable :wink

Mark Jones

Interesting, I received 400ms and 16rps... :wink
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Tedd

It appears to be directly related to the mouse double-click time :wink
Whereas changing the keyboard delay and repeat rates had no effect.
No snowflake in an avalanche feels responsible.

MichaelW

The double-click time is one that I didn't think to check. On my Windows 2000 SP4 system the range is ~1310 ms, 6 repeats per second to ~110ms and 50 repeats per second. The corresponding range for the value returned by GetDoubleClickTime (and also in the registry at HKEY_CURRENT_USER\Control Panel\Mouse\DoubleClickSpeed) is 1650 to 150, the values being the maximum time between the first and second click in ms.
eschew obfuscation

Jimg

On my machine, trying multiple of 100 for SetDoubleClickTime, I find that

where  DC = DoubleClick Time


             DC
  Delay =  -------  * 80  =  .8 * DC
            100

                 100
  Repeat Rate = ------ * 100  =  10000 / DC
                 DC


so rearanging-

  the first delay is (DC/10)*8 and the remaining delays are (DC/10) ms.

Thank again.