How I can get the duration in milliseconds that is valid for a DoubleClick in WPF. The same as in Windows Forms the SystemInformation.DoubleClickTime
-property was.
views:
34answers:
1
+3
A:
You can use P/Invoke to call GetDoubleClickTime directly:
[DllImport("user32.dll")]
static extern uint GetDoubleClickTime();
This will return the number of milliseconds for a double click.
Reed Copsey
2010-09-07 20:39:27
+1 Thanks for your answer. Is there also a version without P/Invoke (and not windows forms)? I try to not use P/Invoke because I don't really know what the penalties in using it are (besides of restriction of code-execution).
HCL
2010-09-07 20:53:54
@HCL: It's pretty much use windows forms, or use P/Invoke. P/Invoke's a bit lighter-weight, since it's not adding any dependencies (except user32.dll, which is part of Windows). There's no native WPF option. [The Windows Forms class, btw, just uses P/Invoke to call the Windows API...]
Reed Copsey
2010-09-07 20:55:55
+1, I just went through all of the InputManager/MouseDevice classes in WPF to double check and there appears to be no other way than P/Invoke or WinForms.
sixlettervariables
2010-09-07 21:00:27