Skip navigation

GetSystemMetrics(SM_MOUSEPRESENT) is used to determine if a mouse is present or not.

Unlike keyboard messages, a window procedure receives mouse event messages even if it is inactive or does not have the input focus. CS_DBLCLKS flag should be set in window class to enable the window to receive mouse double click message.
Capturing the mouse outside the window: SetCapture (hwnd) ;
To release the captured mouse: ReleaseCapture () ;

Client Area Messages usually handled by the window proc:

Button Pressed Released Pressed (Second Click)
Left WM_LBUTTONDOWN WM_LBUTTONUP WM_LBUTTONDBLCLK
Middle WM_MBUTTONDOWN WM_MBUTTONUP WM_MBUTTONDBLCLK
Right WM_RBUTTONDOWN WM_RBUTTONUP WM_RBUTTONDBLCLK

Non-Client Area (menu, title bar, scroll bar) Messages usually handled by the DefWindowProc:

Button Pressed Released Pressed (Second Click)
Left WM_NCLBUTTONDOWN WM_NCLBUTTONUP WM_NCLBUTTONDBLCLK
Middle WM_NCMBUTTONDOWN WM_NCMBUTTONUP WM_NCMBUTTONDBLCLK
Right WM_NCRBUTTONDOWN WM_NCRBUTTONUP WM_NCRBUTTONDBLCLK

The Microsoft IntelliMouse protocol supports WM_MOUSEWHEEL message which enables a little wheel in between two of the mouse buttons.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: