如何确定两次单击之间允许鼠标移动以触发 WM_LBUTTONDBLCLK 消息? [英] How can I determine the amount of movement a mouse is allowed between two click for the WM_LBUTTONDBLCLK message to be fired?

查看:29
本文介绍了如何确定两次单击之间允许鼠标移动以触发 WM_LBUTTONDBLCLK 消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何确定鼠标在两次单击之间允许的移动量以触发 WM_LBUTTONDBLCLK 消息?

How can I determine the amount of movement a mouse is allowed between two click for the WM_LBUTTONDBLCLK message to be fired?

MSDN 接收双击消息

当用户单击鼠标时,操作系统会生成双击消息快速连续两次按钮.当用户点击按钮时,操作系统建立一个以光标热点为中心的矩形.这操作系统还会标记发生点击的时间.当用户再次单击同一个按钮,操作系统会确定热点仍在矩形内并计算经过的时间从第一次点击开始.如果热点仍在矩形内并且经过的时间不超过超时值双击,操作系统会生成一个双击消息.一个应用程序可以通过使用来检索双击的超时值GetDoubleClickTime 函数.

The OS generates a double-click message when the user clicks a mouse button twice in quick succession. When the user clicks a button, the OS establishes a rectangle centered on the hot spot of the cursor. The OS also marks the time at which the click occurred. When the user clicks the same button a second time, the OS determines whether the hot spot is still within the rectangle and calculates the time elapsed since the first click. If the hot spot is still within the rectangle and the elapsed time does not exceed the time-out value for a double-click, the OS generates a double-click message. An application can retrieve the time-out value for a double-click by using the GetDoubleClickTime function.

我能够确定允许的最大时间间隔 GetDoubleClickTime 但是想知道允许的最大鼠标时刻.

I am able to determine the maximum allowed time interval GetDoubleClickTime but would like to know the maximum of mouse moment allowed.

推荐答案

来自 GetSystemMetrics:

第二次点击必须发生在由SM_CXDOUBLECLK 和 SM_CYDOUBLECLK 供系统考虑的两个单击双击.

The second click must occur within the rectangle that is defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click.

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

这篇关于如何确定两次单击之间允许鼠标移动以触发 WM_LBUTTONDBLCLK 消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆