网站首页  词典首页

请输入您要查询的函数:

 

术语 mouse_event
释义 mouse_event
语法:
VOID mouse_event( DWORD dwFlags,
DWORD dx,
DWORD dy,
DWORD dwData,
ULONG_PTR dwExtraInfo
);
mouse_event函数
该mouse_event函数综合鼠标移动和按钮点击。
Windows NT/2000/XP的:此功能已被取代。使用SendInput代替。
参数
dwFlags
[in]的鼠标移动和点击相应按钮指定的各个方面。此参数可以是以下值的某些组合。
指定的值鼠标按钮的状态设置为显示地位的变化,而不是正在进行的情况。例如,如果鼠标左键按下并按住,MOUSEEVENTF_LEFTDOWN设置左边的按钮时,首先按下,但不能为今后的议案。同样,只有MOUSEEVENTF_LEFTUP设置按钮时首次发布。
您不能同时在指定dwFlags参数都MOUSEEVENTF_WHEEL,要么MOUSEEVENTF_XDOWN或MOUSEEVENTF_XUP,因为它们都需要对dwData领域使用。
MOUSEEVENTF_ABSOLUTE
指定镝的dx和参数包含规范化的绝对坐标。如果没有设置,这些参数包括相关数据:在过去的立场,因为报告的立场有所改变。这个标志可以设置或不设置,无论什么样的鼠标或鼠标一种类似的设备,如果有的话,连接到系统。有关相对鼠标运动的进一步资料,请参阅下面的备注部分。
MOUSEEVENTF_MOVE
指定运动的发生。
MOUSEEVENTF_LEFTDOWN
指定左边的按钮已关闭。
MOUSEEVENTF_LEFTUP
指定左边的按钮了。
MOUSEEVENTF_RIGHTDOWN
指定正确的按钮了。
MOUSEEVENTF_RIGHTUP
指定正确的按钮了。
MOUSEEVENTF_MIDDLEDOWN
指定中间的按钮已关闭。
MOUSEEVENTF_MIDDLEUP
指定中间的按钮了。
MOUSEEVENTF_WHEEL
Windows NT/2000/XP的:指定该轮已被移动,如果鼠标有一个滚轮。量的运动中指定dwData
MOUSEEVENTF_XDOWN
视窗2000/XP的:指定一个X按钮被按下。
MOUSEEVENTF_XUP
视窗2000/XP的:指定一个X按钮被释放。
霉素
[in]指定鼠标沿x轴或其运动量绝对位置自上次鼠标事件生成,取决于MOUSEEVENTF_ABSOLUTE设置。绝对的数据被指定为鼠标的实际X坐标,相对数据作为米奇号指定感动。是一个幼稚的数额是一个鼠标移动它的报告,它提出的。

[in]指定鼠标沿y的绝对位置轴或其运动量自上一次鼠标事件生成,取决于MOUSEEVENTF_ABSOLUTE设置。绝对数据作为鼠标的实际y指定坐标,相对数据作为米奇号指定感动。
dwData
[in]如果dwFlags包含MOUSEEVENTF_WHEEL,然后dwData指定轮流动的数量。正值表明,车轮转动着,远离用户,负值表明,旋转的车轮是对落后的用户。一个车轮单击定义为WHEEL_DELTA,这是120。
如果dwFlags包含MOUSEEVENTF_HWHEEL,然后dwData指定轮流动的数量。正值表明,车轮旋转的权利;负值表明,车轮旋转到左边。一个车轮单击定义为WHEEL_DELTA,这是120。
视窗2000/XP的:如果dwFlags包含MOUSEEVENTF_XDOWN或MOUSEEVENTF_XUP,然后dwData指定其中X按钮被按下或释放。这个值可能是下列任何标志的组合。
如果dwFlags不是MOUSEEVENTF_WHEEL,MOUSEEVENTF_XDOWN,或MOUSEEVENTF_XUP,然后dwData应为零。
XBUTTON1
如果第一个设置X按钮被按下或释放。
XBUTTON2
如果第二设置X按钮被按下或释放。
dwExtraInfo
[in]指定一个额外的价值与鼠标事件相关联。一个应用程序调用GetMessageExtraInfo以获取此额外的信息。
返回值
这个函数没有返回值。
备注
如果鼠标的移动,由MOUSEEVENTF_MOVE被设置,dx和dy保存有关资料显示,该议案。这些信息被指定为绝对或相对的整数值。
如果MOUSEEVENTF_ABSOLUTE指定值,则dx和dy含有规范化的绝对坐标0至65,535。在这些事件过程映射到显示表面的坐标。到右下角坐标(0,0)映射到显示表面的左上角,(65535,65535)的地图。
如果MOUSEEVENTF_ABSOLUTE值没有指定,dx和dy指定从当最后鼠标事件是产生相对运动(最后报告的位置)。正值表示鼠标移动的权利(或下跌);负值表示鼠标向左移动(或以上)。
相对鼠标移动是受了鼠标速度和加速度级别的设置。最终用户使用这些值设置在控制面板中鼠标的应用。一个应用程序获得,并设置与使用SystemParametersInfo函数的这些值。
该制度适用于两个测试到指定的相对运动时,用鼠标加速度。如果不是沿X或Y轴是比第一个鼠标阈值时指定的距离,鼠标加速度不为零的Level,操作系统双打的距离。如果沿无论是X或者Y轴指定的距离大于第二个鼠标阈值,鼠标加速级别等于2,操作系统的两倍,从应用第一阈值测试结果的距离。因此有可能对操作系统,以乘以4倍比较,沿X或Y轴指定鼠标的议案。
一旦已应用加速,系统级的鼠标所期望的速度带来的价值。鼠标速度范围从1(最慢)到20(最快),代表多少指针移动的距离为基础的鼠标移动。默认值是10,在任何其他修改而导致鼠标的议案。
该mouse_event函数是用来合成鼠标事件的应用程序需要这样做。它也使用的应用程序需要得到比自己的立场和按钮的状态鼠标更多的信息。例如,如果一个平板制造商希望通过笔为基础的信息,以它自己的应用程序,它可以写一个DLL,直接向平板硬件进行通信,获取额外的信息,并保存在队列中。然后调用该DLL的标准按钮和x / y位置数据,以及mouse_event,在dwExtraInfo参数,有些指针或索引的排队额外的信息。当应用程序需要额外的信息,它调用的指针或dwExtraInfo存储指数的DLL,和DLL返回额外的信息。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为Unicode版本。
参见
鼠标输入,GetMessageExtraInfo,SystemParametersInfo
==英文原文==mouse_event Function
The mouse_event function synthesizes mouse motion and button clicks.
Windows NT/2000/XP: This function has been superseded. Use SendInput instead.
Syntax
VOID mouse_event( DWORD dwFlags,
DWORD dx,
DWORD dy,
DWORD dwData,
ULONG_PTR dwExtraInfo
);
Parameters
dwFlags
[in] Specifies various aspects of mouse motion and button clicking. This parameter can be certain combinations of the following values.
The values that specify mouse button status are set to indicate changes in status, not ongoing conditions. For example, if the left mouse button is pressed and held down, MOUSEEVENTF_LEFTDOWN is set when the left button is first pressed, but not for subsequent motions. Similarly, MOUSEEVENTF_LEFTUP is set only when the button is first released.
You cannot specify both MOUSEEVENTF_WHEEL and either MOUSEEVENTF_XDOWN or MOUSEEVENTF_XUP simultaneously in the dwFlags parameter, because they both require use of the dwData field.
MOUSEEVENTF_ABSOLUTE
Specifies that the dx and dy parameters contain normalized absolute coordinates. If not set, those parameters contain relative data: the change in position since the last reported position. This flag can be set, or not set, regardless of what kind of mouse or mouse-like device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
MOUSEEVENTF_MOVE
Specifies that movement occurred.
MOUSEEVENTF_LEFTDOWN
Specifies that the left button is down.
MOUSEEVENTF_LEFTUP
Specifies that the left button is up.
MOUSEEVENTF_RIGHTDOWN
Specifies that the right button is down.
MOUSEEVENTF_RIGHTUP
Specifies that the right button is up.
MOUSEEVENTF_MIDDLEDOWN
Specifies that the middle button is down.
MOUSEEVENTF_MIDDLEUP
Specifies that the middle button is up.
MOUSEEVENTF_WHEEL
Windows NT/2000/XP: Specifies that the wheel has been moved, if the mouse has a wheel. The amount of movement is specified in dwData
MOUSEEVENTF_XDOWN
Windows 2000/XP: Specifies that an X button was pressed.
MOUSEEVENTF_XUP
Windows 2000/XP: Specifies that an X button was released.
dx
[in] Specifies the mouse's absolute position along the x-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse's actual x-coordinate; relative data is specified as the number of mickeys moved. A mickey is the amount that a mouse has to move for it to report that it has moved.
dy
[in] Specifies the mouse's absolute position along the y-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse's actual y-coordinate; relative data is specified as the number of mickeys moved.
dwData
[in] If dwFlags contains MOUSEEVENTF_WHEEL, then dwData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.
If dwFlags contains MOUSEEVENTF_HWHEEL, then dwData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left. One wheel click is defined as WHEEL_DELTA, which is 120.
Windows 2000/XP: If dwFlags contains MOUSEEVENTF_XDOWN or MOUSEEVENTF_XUP, then dwData specifies which X buttons were pressed or released. This value may be any combination of the following flags.
If dwFlags is not MOUSEEVENTF_WHEEL, MOUSEEVENTF_XDOWN, or MOUSEEVENTF_XUP, then dwData should be zero.
XBUTTON1
Set if the first X button was pressed or released.
XBUTTON2
Set if the second X button was pressed or released.
dwExtraInfo
[in] Specifies an additional value associated with the mouse event. An application calls GetMessageExtraInfo to obtain this extra information.
Return Value
This function has no return value.
Remarks
If the mouse has moved, indicated by MOUSEEVENTF_MOVE being set, dx and dy hold information about that motion. The information is specified as absolute or relative integer values.
If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
If the MOUSEEVENTF_ABSOLUTE value is not specified, dx and dy specify relative motions from when the last mouse event was generated (the last reported position). Positive values mean the mouse moved right (or down); negative values mean the mouse moved left (or up).
Relative mouse motion is subject to the settings for mouse speed and acceleration level. An end user sets these values using the Mouse application in Control Panel. An application obtains and sets these values with the SystemParametersInfo function.
The system applies two tests to the specified relative mouse motion when applying acceleration. If the specified distance along either the x or y axis is greater than the first mouse threshold value, and the mouse acceleration level is not zero, the operating system doubles the distance. If the specified distance along either the x- or y-axis is greater than the second mouse threshold value, and the mouse acceleration level is equal to two, the operating system doubles the distance that resulted from applying the first threshold test. It is thus possible for the operating system to multiply relatively-specified mouse motion along the x- or y-axis by up to four times.
Once acceleration has been applied, the system scales the resultant value by the desired mouse speed. Mouse speed can range from 1 (slowest) to 20 (fastest) and represents how much the pointer moves based on the distance the mouse moves. The default value is 10, which results in no additional modification to the mouse motion.
The mouse_event function is used to synthesize mouse events by applications that need to do so. It is also used by applications that need to obtain more information from the mouse than its position and button state. For example, if a tablet manufacturer wants to pass pen-based information to its own applications, it can write a DLL that communicates directly to the tablet hardware, obtains the extra information, and saves it in a queue. The DLL then calls mouse_event with the standard button and x/y position data, along with, in the dwExtraInfo parameter, some pointer or index to the queued extra information. When the application needs the extra information, it calls the DLL with the pointer or index stored in dwExtraInfo, and the DLL returns the extra information.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as Unicode version.
See Also
Mouse Input , GetMessageExtraInfo , SystemParametersInfo
==原始网址==http://msdn.microsoft.com/en-us/library/ms646260(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 9:24:13