4

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?

James Cadd
  • 12,136
  • 30
  • 85
  • 134

3 Answers3

8

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

Ben S
  • 96
  • 1
1

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.

Ken White
  • 123,280
  • 14
  • 225
  • 444
0

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.

Community
  • 1
  • 1
xamid
  • 440
  • 11
  • 25