是鼠标单击 WM_* 消息还是 up & 的组合关闭消息?

发布于 2024-08-04 14:44:31 字数 166 浏览 2 评论 0原文

我习惯于使用 Windows 框架,该框架提供诸如鼠标单击或鼠标双击之类的事件。单击事件是 Windows 构造(即 Windows 发送 WM_DOUBLECLICK 或类似消息)还是将 WM_MOUSEDOWN 和 WM_MOUSEUP 发送到应用程序,然后应用程序进行一些数学运算来确定该事件是单击还是其他事件?

I'm used to working with a Windows framework that provides events for things like a mouse click or a mouse double click. Are click events a Windows construct (i.e. does Windows send a WM_DOUBLECLICK or similar message) or does it send WM_MOUSEDOWN and WM_MOUSEUP to applications which then do some math to decide if the event was a click or otherwise?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟火散人牵绊 2024-08-11 14:44:31

根据 MSDN 文档,您的消息的正确顺序双击事件将看到 - WM_LBUTTONDOWN、WM_LBUTTONUP、WM_LBUTTONDBLCLK 和 WM_LBUTTONUP

According to MSDN documentation The correct order of messages you will see for double click event are - WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, and WM_LBUTTONUP

星軌x 2024-08-11 14:44:31

它是通过 WindowProc() 发送的消息的组合。鼠标左键的消息为 WM_LBUTTONDOWN、WM_LBUTTONDBLCLK、WM_LBUTTONUP,中键的消息为 WM_MBUTTONDOWN 等,鼠标右键的消息为 WM_RBUTTONDOWN 等。有关详细信息,请参阅 MSDN 上的 Windows SDK 。

It's a combination of messages sent through the WindowProc(). The messages are WM_LBUTTONDOWN, WM_LBUTTONDBLCLK, WM_LBUTTONUP for the left mouse button, WM_MBUTTONDOWN and so forth for the middle button, and WM_RBUTTONDOWN and so forth for the right mouse button. See the Windows SDK at MSDN for more info.

莫言歌 2024-08-11 14:44:31

鼠标单击不是 Windows 消息的组合,但它可以导致,具体取决于单击的应用程序。
Windows 输入和 Windows 消息之间存在巨大差异,因为它们只是某些应用程序的工具,以多种不同的方式使用,如 MSDN 上所述:

我还提供了一个示例,清楚地显示了我的问题中的差异如何在一个 Windows 客户端上使用多个光标? 它显示了通过单击发送哪些消息,并且 Windows 消息通常不足以模拟鼠标单击,但如果可以,则可以如何使用它们。

A mouse click is not a combination of windows messages, but it can lead to, depending on the application that is clicked.
There is a huge difference between windows input and windows messages, as they are only a tool for some applications, used in many different ways, as explained on MSDN:

I also provided an example that shows the difference clearly in my question How could it work to use multiple cursors on one Windows client? It shows what messages are sent by clicking and that windows messages are often not enough to emulate a mouse click, but if they are, how they can be used.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文