views:

642

answers:

2

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?

+1  A: 

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
+2  A: 

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
Thanks, this looks like the correct sequence.
James Cadd