网站首页  词典首页

请输入您要查询的函数:

 

术语 getmousemovepointsex
释义 GetMouseMovePointsEx
语法:
int GetMouseMovePointsEx( UINT cbSize,
LPMOUSEMOVEPOINT lppt,
LPMOUSEMOVEPOINT lpptBuf,
int nBufPoints,
DWORD resolution
);
GetMouseMovePointsEx功能
该GetMouseMovePointsEx函数检索高达64以前的历史鼠标或笔坐标。
参数
cbSize
[in]指定的大小,以字节为单位,在MOUSEMOVEPOINT结构。
lppt
[in]指向1 MOUSEMOVEPOINT结构,有效遏制鼠标坐标(屏幕坐标)。它可能还包含一个时间戳。
规划中的鼠标点GetMouseMovePointsEx功能搜索坐标的历史。如果函数发现这一点,它返回之前的最后nBufPoints并包括供应点。
如果您的应用提供了一种时间戳,GetMouseMovePointsEx功能将用它来点之间的区分两个平等的人在不同的时间记录。
应用程序应该调用这个函数使用鼠标坐标收到WM_MOUSEMOVE消息并将其转换为屏幕坐标。
lpptBuf
[in]指向的缓冲区将获得积分。它至少应为cbSize大小* nBufPoints。
nBufPoints
[in] Specifies the number of points to retrieve.
决议
[in]指定所需的决议。此参数可以是下列值之一。
GMMP_USE_DISPLAY_POINTS
检索点使用的显示分辨率。
GMMP_USE_HIGH_RESOLUTION_POINTS
获取高分辨率点。积分范围可以从0到65,535在x(0xFFFF的)和y坐标。这是绝对的协调提供的决议指出,如绘画片设备。
返回值
如果函数成功,返回值是点缓冲区中。否则,该函数返回-1。对于扩展的错误信息,您的应用程序可以调用GetLastError函数。 GetLastError函数可能会返回以下错误代码。
ValueMeaning
GMMP_ERR_POINT_NOT_FOUNDThe点lppt指定找不到或不再是系统中的缓冲区。
备注
该系统保留了最后64鼠标坐标和时间邮票。如果您的应用提供了一种协调,GetMouseMovePointsEx鼠标和坐标系统中的鼠标坐标历史的存在,该函数检索指定数目的坐标系统的历史。您也可以提供一个时间戳,这将被用来区分之间的相同点的历史。
该GetMouseMovePointsEx函数将返回,最终被派往不仅调用线程,也有其他线程点。
GetMouseMovePointsEx可能失败或返回在下列情况下错误值:
如果消极的坐标是在MOUSEMOVEPOINT结构通过。
如果GetMouseMovePointsEx检索协调负值。
这些情况可能会出现多台监视器,如果存在。要纠正这一点,首先调用GetSystemMetrics来得到以下值:
SM_XVIRTUALSCREEN,
SM_YVIRTUALSCREEN,
SM_CXVIRTUALSCREEN, and
SM_CYVIRTUALSCREEN.
Then, for each point that is returned from GetMouseMovePointsEx, perform the following transform:
int nVirtualWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN) ;
int nVirtualHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN) ;
int nVirtualLeft = GetSystemMetrics(SM_XVIRTUALSCREEN) ;
int nVirtualTop = GetSystemMetrics(SM_YVIRTUALSCREEN) ;
int cpt = 0 ;
int mode = GMMP_USE_DISPLAY_POINTS ;
MOUSEMOVEPOINT mp_in ;
MOUSEMOVEPOINT mp_out[64] ;
ZeroMemory(&mp_in, sizeof(mp_in)) ;
mp_in.x = pt.x & 0x0000FFFF ;//Ensure that this number will pass through.
mp_in.y = pt.y & 0x0000FFFF ;
cpt = GetMouseMovePointsEx(&mp_in, &mp_out, 64, mode) ;
for (int i = 0; i < cpt; i++)
{
switch(mode)
{
case GMMP_USE_DISPLAY_POINTS:
if (mp_out[i].x > 32767)
mp_out[i].x -= 65536 ;
if (mp_out[i].y > 32767)
mp_out[i].y -= 65536 ;
break ;
case GMMP_USE_HIGH_RESOLUTION_POINTS:
mp_out[i].x = ((mp_out[i].x * (nVirtualWidth - 1)) - (nVirtualLeft * 65536)) / nVirtualWidth ;
mp_out[i].y = ((mp_out[i].y * (nVirtualHeight - 1)) - (nVirtualTop * 65536)) / nVirtualHeight ;
break ;
}
}
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低经营systemsMillennium时,Windows 2000
参见
鼠标输入,MOUSEMOVEPOINT
==英文原文==GetMouseMovePointsEx Function
The GetMouseMovePointsEx function retrieves a history of up to 64 previous coordinates of the mouse or pen.
Syntax
int GetMouseMovePointsEx( UINT cbSize,
LPMOUSEMOVEPOINT lppt,
LPMOUSEMOVEPOINT lpptBuf,
int nBufPoints,
DWORD resolution
);
Parameters
cbSize
[in] Specifies the size, in bytes, of the MOUSEMOVEPOINT structure.
lppt
[in] Pointer to a MOUSEMOVEPOINT structure containing valid mouse coordinates (in screen coordinates). It may also contain a time stamp.
The GetMouseMovePointsEx 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 GetMouseMovePointsEx 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
[in] Pointer to a buffer that will receive the points. It should be at least cbSize* nBufPoints in size.
nBufPoints
[in] Specifies the number of points to retrieve.
resolution
[in] Specifies the resolution desired. This parameter can be one of the following values.
GMMP_USE_DISPLAY_POINTS
Retrieves the points using the display resolution.
GMMP_USE_HIGH_RESOLUTION_POINTS
Retrieves high resolution points. Points can range from zero to 65,535 (0xFFFF) in both x- and y-coordinates. This is the resolution provided by absolute coordinate pointing devices such as drawing tablets.
Return Value
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.
ValueMeaning
GMMP_ERR_POINT_NOT_FOUNDThe point specified by lppt 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 GetMouseMovePointsEx 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 GetMouseMovePointsEx function will return points that eventually were dispatched not only to the calling thread but also to other threads.
GetMouseMovePointsEx may fail or return erroneous values in the following cases:
If negative coordinates are passed in the MOUSEMOVEPOINT structure.
If GetMouseMovePointsEx retrieves a coordinate with a negative value.
These situations can occur if multiple monitors are present. To correct this, first call GetSystemMetrics to get the following values:
SM_XVIRTUALSCREEN,
SM_YVIRTUALSCREEN,
SM_CXVIRTUALSCREEN, and
SM_CYVIRTUALSCREEN.
Then, for each point that is returned from GetMouseMovePointsEx, perform the following transform:
int nVirtualWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN) ;
int nVirtualHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN) ;
int nVirtualLeft = GetSystemMetrics(SM_XVIRTUALSCREEN) ;
int nVirtualTop = GetSystemMetrics(SM_YVIRTUALSCREEN) ;
int cpt = 0 ;
int mode = GMMP_USE_DISPLAY_POINTS ;
MOUSEMOVEPOINT mp_in ;
MOUSEMOVEPOINT mp_out[64] ;
ZeroMemory(&mp_in, sizeof(mp_in)) ;
mp_in.x = pt.x & 0x0000FFFF ;//Ensure that this number will pass through.
mp_in.y = pt.y & 0x0000FFFF ;
cpt = GetMouseMovePointsEx(&mp_in, &mp_out, 64, mode) ;
for (int i = 0; i < cpt; i++)
{
switch(mode)
{
case GMMP_USE_DISPLAY_POINTS:
if (mp_out[i].x > 32767)
mp_out[i].x -= 65536 ;
if (mp_out[i].y > 32767)
mp_out[i].y -= 65536 ;
break ;
case GMMP_USE_HIGH_RESOLUTION_POINTS:
mp_out[i].x = ((mp_out[i].x * (nVirtualWidth - 1)) - (nVirtualLeft * 65536)) / nVirtualWidth ;
mp_out[i].y = ((mp_out[i].y * (nVirtualHeight - 1)) - (nVirtualTop * 65536)) / nVirtualHeight ;
break ;
}
}
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsMillennium, Windows 2000
See Also
Mouse Input , MOUSEMOVEPOINT
==原始网址==http://msdn.microsoft.com/en-us/library/ms646259(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:25:53