Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 378
James Cadd Avatar asked Jan 24 '23 05:01

James Cadd


2 Answers

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

like image 116
Ben S Avatar answered Jan 25 '23 18:01

Ben S


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.

like image 41
Ken White Avatar answered Jan 25 '23 18:01

Ken White