WM_POINTERENTER message
Sent to a window when a new pointer enters detection range over the window (hover) or when an existing pointer moves within the boundaries of the window.
A window receives this message through its WindowProc function.
![Important]
Desktop apps should be DPI aware. If your app is not DPI aware, screen coordinates contained in pointer messages and related structures might appear inaccurate due to DPI virtualization. DPI virtualization provides automatic scaling support to applications that are not DPI aware and is active by default (users can turn it off). For more information, see Writing High-DPI Win32 Applications.
#define WM_POINTERENTER 0x0249
Parameters
-
wParam
-
Contains the pointer identifier and additonal information. Use the following macros to retrieve specific information in the wParam parameter.
- GET_POINTERID_WPARAM(wParam): the pointer identifier.
- IS_POINTER_NEW_WPARAM(wParam): indicates whether this message is the first message generated by a new pointer entering detection range (hover).
- IS_POINTER_INRANGE_WPARAM(wParam): indicates whether this message was generated by a pointer that has not left detection range. This flag is always set for WM_POINTERENTER messages.
- IS_POINTER_INCONTACT_WPARAM(wParam): a flag that indicates whether this message was generated by a pointer that is in contact. This flag is not set for a pointer in detection range (hover).
-
lParam
-
Contains the point location of the pointer.
Note
Because the pointer may make contact with the device over a non-trivial area, this point location may be a simplification of a more complex pointer area. Whenever possible, an application should use the complete pointer area information instead of the point location.
Use the following macros to retrieve the physical screen coordinates of the point.
- GET_X_LPARAM(lParam): the x (horizontal point) coordinate.
- GET_Y_LPARAM(lParam): the y (vertical point) coordinate.
Return value
If an application processes this message, it should return zero.
If the application does not process this message, it should call DefWindowProc.
Remarks
The WM_POINTERENTER notification can be used by a window to provide feedback to the user while the pointer is over its surface or to otherwise react to the presence of a pointer over its surface.
This notification is only sent to the window that is receiving input for the pointer. The following table lists some of the situations in which this notification is sent.
Action | Flags Set | Notifications Sent To |
---|---|---|
A new pointer enters detection range (hover). | IS_POINTER_NEW_WPARAM IS_POINTER_INRANGE_WPARAM |
Window over which the pointer enters detection range. |
A hovering pointer crosses within the window boundaries. | IS_POINTER_INRANGE_WPARAM |
Window within which the pointer has crossed. |
![Important]
When a window loses capture of a pointer and it receives the WM_POINTERCAPTURECHANGED notification, it typically will not receive any further notifications. For this reason, it is important that you not make any assumptions based on evenly paired WM_POINTERDOWN/WM_POINTERUP or WM_POINTERENTER/WM_POINTERLEAVE notifications.
When inputs come from the mouse, as a result of mouse and pointer message integration, WM_POINTERENTER is not sent.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 8 [desktop apps only] |
Minimum supported server |
Windows Server 2012 [desktop apps only] |
Header |
|