Is a mouse click a WM_ * message or a combination of up and down messages?

I'm used to working with the Windows framework, which provides events for things such as a mouse click or double-click. Are click events a Windows construct (that is, Windows sends WM_DOUBLECLICK or a similar message) or sends WM_MOUSEDOWN and WM_MOUSEUP to applications that then do some math to decide if the event was a click or otherwise?

+3
source share
3 answers

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

+7
source

This is a combination of messages sent through WindowProc (). Messages: WM_LBUTTONDOWN, WM_LBUTTONDBLCLK, WM_LBUTTONUP for the left mouse button, WM_MBUTTONDOWN, etc. For the middle button, WM_RBUTTONDOWN, etc. For the right mouse button. See the Windows SDK on MSDN for more information .

+1
source

, , . Windows, , , MSDN:

I also presented an example that clearly shows the difference in my question. How could it work with multiple cursors on the same Windows client? It shows which messages are sent a click and the fact that Windows messages are often not enough to emulate a mouse click, but if they are, then how they can be used.

0
source

Source: https://habr.com/ru/post/1717961/


All Articles