2

The TPageControl Component in Delphi does not have a DoubleClick-Event so I made my own. Currently, my custom DoubleClick event gets called when i click twice within 300ms. But I was wondering if there's a way to get the double click speed value that's set in the Windows control panel.

Does anyone know of a way of accessing that value? It's not super crucial. I can just hardcode a value like 300ms, but I think it would be really cool if it was the actual value. Maybe with the Windows API?

Thanks!

jan_tera
  • 55
  • 2
  • 4
    Make sure you understand, that double clicks do not only have to happen within a particular time interval, but also within a constrained area. [How can I determine the amount of movement a mouse is allowed between two click for the WM_LBUTTONDBLCLK message to be fired?](https://stackoverflow.com/q/30496521/1889329) has more information. – IInspectable Dec 12 '19 at 13:26
  • I already accounted for this in my code. When the selected tab in the first click is the same as the selected tab in the second click, then execute whatever has to be executed. – jan_tera Dec 12 '19 at 14:21

1 Answers1

6

It is easy to get this value using the Windows API. Simply use the GetDoubleClickTime function.

Notice that this particular system parameter value is special. Most others are obtained not using special functions, but using the GetSystemMetrics or the SystemParametersInfo function.

Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384