PDA

View Full Version : WM_MOUSE



lsdi
07-25-2002, 09:24 PM
How do I get the mouse coord on mouse events?

ramo
07-26-2002, 01:19 PM
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_MBUTTONDOWN
WM_MBUTTONUP
.......

L -> left
M -> Middle
R -> Right


xPos = LOWORD(lParam); // horizontal position of cursor
yPos = HIWORD(lParam); // vertical position of cursor

wParam 's value is for virtual keys
MK_CONTROL Set if the CTRL key is down.
MK_LBUTTON Set if the left mouse button is down.
MK_MBUTTON Set if the middle mouse button is down.
MK_RBUTTON Set if the right mouse button is down.
MK_SHIFT Set if the SHIFT key is down.

you can use and "&" operator to choose.