|
Client Area Mouse Messages
A window receives a client area mouse message when a mouse event occurs within
the window's client area. The system posts the WM_MOUSEMOVE message to the window when the user moves the cursor within the client area.
It posts one of the following messages when the user presses or releases a
mouse button while the cursor is within the client area.
Message Parameters
The lParam parameter of a client area mouse message indicates the position of the cursor
hot spot. The low-order word indicates the x-coordinate of the hot spot, and
the high-order word indicates the y-coordinate. The coordinates are given in client coordinates. In the client coordinate system, all points on the screen are given relative
to the coordinates (0,0) of the upper left corner of the client area.
The wParam parameter contains flags that indicate the status of the other mouse buttons
and the CTRL and SHIFT keys at the time of the mouse event. You can check for these flags when
mouse-message processing depends on the state of another mouse button or of the CTRL or SHIFT key. The lParam parameter can be a combination of the following values.
Value
| Meaning
| MK_CONTROL
| The CTRL key is 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
| The SHIFT key is down.
|
Double-Click Messages
The system generates a double-click message when the user clicks a mouse
button twice in quick succession. When the user clicks a button, the system
establishes a rectangle centered around the cursor hot spot. It also marks the time at
which the click occurred. When the user clicks the same button a second time,
the system determines whether the hot spot is still within the rectangle and
calculates the time elapsed since the first click. If the hot spot is still within
the rectangle and the elapsed time does not exceeded the double-click time-out
value, the system generates a double-click message.
An application can get and set double-click time-out values by using the GetDoubleClickTime and SetDoubleClickTime functions, respectively. Alternatively, the application can set the
double-click time-out value by using the SPI_SETDOUBLECLICKTIME flag with the SystemParametersInfo function. It can also set the size of the rectangle that Windows uses to
detect double-clicks by passing the SPI_SETDOUBLECLKWIDTH and
SPI_SETDOUBLECLKHEIGHT flags to SystemParametersInfo. Note, however, that setting the double-click time-out value and rectangle
affects all applications.
An application-defined window does not, by default, receive double-click
messages. Because of the system overhead involved in generating double-click
messages, these messages are generated only for windows belonging to classes that have
the CS_DBLCLKS class style. Your application must set this style when
registering the window class. For more information about window classes, see Window Classes.
A double-click message is always the third message in a four-message series.
The first two messages are the button down and button up messages generated by
the first click. The second click generates the double-click message followed by
another button up message. For example, double-clicking the left mouse button
generates the following message sequence:
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_LBUTTONDBLCLK
WM_LBUTTONUP
Because a window always receives a button down message before receiving a
double-click message, an application typically uses a double-click message to
extend a task it began during a button down message. For example, when the user
clicks a color in the color palette of Windows Paintbrush™, Paintbrush displays the selected color next to the palette. When the user
double-clicks a color, Paintbrush displays the color and opens the Edit Colors
dialog box.
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|