GetMouseMovePoints

[This is preliminary documentation and subject to change.]

The GetMouseMovePoints function retrieves a history of up to 64 previous coordinates of the mouse or pen.

int GetMouseMovePoints(
  UINT cbSize                // size of the MOUSEMOVEPOINT struct
  LPMOUSEMOVEPOINT lppt,     // pointer to current mouse move point
  LPMOUSEMOVEPOINT lpptBuf,  // buffer to store the points
  int nBufPoints,            // how many points the buffer can store
  DWORD resolution           // resolution of the points
);
 

Parameters

cbSize
Size of the MOUSEMOVEPOINT structure.
lppt
Pointer to a MOUSEMOVEPOINT structure containing valid mouse coordinates (in screen coordinates). It may also contain a time stamp.

The GetMouseMovePoints function searches for the point in the mouse coordinates history. If the function finds the point, it returns the last nBufPoints prior to and including the supplied point.

If your application supplies a time stamp, the GetMouseMovePoints function will use it to differentiate between two equal points that were recorded at different times.

An application should call this function using the mouse coordinates received from the WM_MOUSEMOVE message and convert them to screen coordinates.

lpptBuf
Pointer to a buffer that will receive the points. It should be at least cbSize*nBuffPoints in size.
nBufPoints
Specifies the number of points to retrieve.
resolution
Specifies the resolution desired. This parameter can be one of the following values.
Value Meaning
GMMP_USE_DISPLAY_POINTS Retrieves the points using the display resolution.
GMMP_USE_DRIVER_POINTS Retrieves the points using the driver resolution. The Windows CE platform supports pen drivers with a resolution much higher than the display resolution. In this case, GetMouseMovePoints can be used by applications (such as handwriting recognition software or computer-aided design software) that need a much more accurate resolution.

Return Values

If the function succeeds, the return value is the number of points in the buffer. Otherwise, the function returns –1. For extended error information, your application can call GetLastError. The GetLastError function may return the following error code.

Value Meaning
GMMP_ERR_POINT_NOT_FOUND The point specified by lppt is could not be found or is no longer in the system buffer.

Remarks

The system retains the last 64 mouse coordinates and their time stamps. If your application supplies a mouse coordinate to GetMouseMovePoints and the coordinate exists in the system's mouse coordinate history, the function retrieves the specified number of coordinates from the systems' history. You can also supply a time stamp, which will be used to differentiate between identical points in the history.

The GetMouseMovePoints function will return points that eventually were dispatched not only to the calling thread but also to other threads.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98.
  Windows CE: Requires version 2.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Mouse Input Overview, Mouse Input Functions, MOUSEMOVEPOINT