News:

GinGly.com - Used by 85,000 Members - SMS Backed up 7,35,000 - Contacts Stored  28,850 !!

Main Menu

Mouse Up& Down Messages

Started by sukishan, Jul 12, 2009, 05:53 PM

Previous topic - Next topic

sukishan

Mouse-Down Messages

Imagine the user has located a position or an item on a document and presses one of the mouse buttons. While the button is pressed and is down, a button-down message is sent, depending on the button that was pressed. If the left mouse button was pressed, an ON_WM_LBUTTONDOWN message is sent. The syntax of this message is:

afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
If the right mouse button was pressed, an ON_WM_RBUTTONDOWN message is sent.

Its syntax is:
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
The first argument, nFlags, specifies what button is down or what keyboard key and what mouse button are down. It is a

constant integer that can have one of the following values:
MK_CONTROL: A Ctrl key is held down.
MK_LBUTTON: The left mouse button is down.
MK_MBUTTON: The middle mouse button is down.
MK_RBUTTON: The right mouse button is down.
MK_SHIFT: A Shift key is held down.
The point argument specifies the measure from the left and the top borders of the window to the mouse pointer.


**********************************************************************************************
The Mouse-Up Messages

After pressing a mouse button, the user usually releases it. While the button is being released, a button-up message is sent and it depends on the button, left or right, that was down.

If the left mouse is being released, the ON_WM_LBUTTONUP message is sent. Its syntax is:

afx_msg void OnLButtonUp(UINT nFlags, CPoint point);If the right mouse is being released, the ON_WM_TBUTTONUP message is sent. Its syntax is:

afx_msg void OnRButtonUp(UINT nFlags, CPoint point);The first argument, nFlags, specifies what button, right or middle, is down or what keyboard key and what mouse button were down. It is a constant integer that can have one of the following values:
MK_CONTROL: A Ctrl key was held down.
MK_MBUTTON: The middle mouse button was down.
MK_RBUTTON: The right mouse button was down.
MK_SHIFT: A Shift key was held.

The point argument specifies the measure from the (0, 0) origin of the window to the mouse pointer.
A good beginning makes a good ending