How do I determine the amount of movement that the mouse allows between two mouse clicks for a WM_LBUTTONDBLCLK message?

How do I determine the amount of movement that the mouse allows between two mouse clicks for a WM_LBUTTONDBLCLK message?

MSDN Getting Double Click Messages

The OS generates a double-click message when the user clicks the mouse twice in a row. When the user presses the button, the OS places a rectangle centered on the cursor hotspot. The OS also notes the time at which the click occurred. When the user presses the same button a second time, the OS determines if the hotspot is still within the rectangle and calculates the elapsed time since the first click. If the hotspot is still in the rectangle and the elapsed time does not exceed the timeout value for double click, the OS generates a double click message. An application can get the double-click timeout value using the GetDoubleClickTime function.

I can determine the maximum allowable GetDoubleClickTime time interval , but would like to know the maximum allowable value for the moment of the mouse.

+3


source to share


1 answer


From the documentation for GetSystemMetrics :

The second click must appear inside the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider two double-clicks.



int x_limit = GetSystemMetrics(SM_CXDOUBLECLK);
int y_limit = GetSystemMetrics(SM_CYDOUBLECLK);

      

+6


source







All Articles