Delphi WinAPI INPUT_MOUSE - 包含有关模拟鼠标事件的信息。
原型:
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT, *PMOUSEINPUT, *LPMOUSEINPUT;
Delphi:
type
PMouseInput = ^TMouseInput;
{$EXTERNALSYM tagMOUSEINPUT}
tagMOUSEINPUT = packed record
dx: Longint;
dy: Longint;
mouseData: DWORD;
dwFlags: DWORD;
time: DWORD;
dwExtraInfo: DWORD;
end;
TMouseInput = tagMOUSEINPUT;
参数:
- dx(Type: LONG) //鼠标的绝对位置,或自上次生成鼠标事件以来的运动量,取决于dwFlags成员的值。绝对数据指定为鼠标的x坐标;相对数据指定为移动的像素数。
- dy(Type: LONG) //鼠标的绝对位置,或自上次生成鼠标事件以来的运动量,取决于dwFlags成员的值。绝对数据指定为鼠标的y坐标;相对数据指定为移动的像素数。
- mouseData(Type: DWORD) //
- 如果dwFlags包含MOUSEEVENTF_WHEEL,则mouseData指定轮子的移动量。正值表示车轮向前旋转,远离用户;负值表示轮子向后旋转,朝向用户。一次车轮咔嗒声被定义为车轮_DELTA,即120。
- Windows Vista:如果dwFlags包含MOUSEEVENTF_HWHEEL,则dwData指定轮子的移动量。正值表示车轮向右旋转;负值表示车轮向左旋转。一次车轮咔嗒声被定义为车轮_DELTA,即120。
- 如果dwFlags不包含MOUSEEVENTF_WHEEL、MOUSEEVENTF_XDOWN或MOUSEEVENTF_XUP,则mouseData应为零。
- 如果dwFlags包含MOUSEEVENTF_XDOWN或MOUSEEVENTF_XUP,则mouseData指定按下或释放了哪些X按钮。此值可以是以下标志的任意组合。
-
-
- XBUTTON1 0x0001 //设置是否按下或释放第一个X按钮。
- XBUTTON2 0x0002 //设置是否按下或释放第二个X按钮。
-
- dwFlags(Type: DWORD)time(Type: DWORD) //事件的时间戳,以毫秒为单位。如果此参数为0,系统将提供自己的时间戳。
- 一组位标志,用于指定鼠标移动和按钮单击的各个方面。此成员中的位可以是以下值的任何合理组合。
- 指定鼠标按钮状态的位标志被设置为指示状态的更改,而不是正在进行的条件。例如,如果按下并按住鼠标左键,则在第一次按下鼠标左键时会设置MOUSEEVENTF_LEFTDOWN,但不用于后续动作。同样,MOUSEEVENTF_LEFTUP仅在第一次释放按钮时设置。
- 不能在dwFlags参数中同时指定MOUSEEVENTF_WHEEL标志和MOUSEEVENTF_XDOWN或MOUSEEVENTF_XUP标志,因为它们都需要使用mouseData字段。
- MOUSEEVENTF_MOVE //0x0001 Movement occurred.
- MOUSEEVENTF_LEFTDOWN //0x0002 The left button was pressed.
- MOUSEEVENTF_LEFTUP //0x0004 The left button was released.
- MOUSEEVENTF_RIGHTDOWN //0x0008 The right button was pressed.
- MOUSEEVENTF_RIGHTUP //0x0010 The right button was released.
- MOUSEEVENTF_MIDDLEDOWN //0x0020 The middle button was pressed.
- MOUSEEVENTF_MIDDLEUP //0x0040 The middle button was released.
- MOUSEEVENTF_XDOWN //0x0080 An X button was pressed.
- MOUSEEVENTF_XUP //0x0100 An X button was released.
- MOUSEEVENTF_WHEEL //0x0800 The wheel was moved, if the mouse has a wheel. The amount of movement is specified in mouseData.
- MOUSEEVENTF_HWHEEL //0x1000 The wheel was moved horizontally, if the mouse has a wheel. The amount of movement is specified in mouseData. Windows XP/2000: This value is not supported.
- MOUSEEVENTF_MOVE_NOCOALESCE //0x2000 The WM_MOUSEMOVE messages will not be coalesced. The default behavior is to coalesce WM_MOUSEMOVE messages. Windows XP/2000: This value is not supported.
- MOUSEEVENTF_VIRTUALDESK //0x4000 Maps coordinates to the entire desktop. Must be used with MOUSEEVENTF_ABSOLUTE.
- MOUSEEVENTF_ABSOLUTE //0x8000 The dx and dy members contain normalized absolute coordinates. If the flag is not set, dxand dy 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 other pointing device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
- dwExtraInfo(Type: ULONG_PTR) //与鼠标事件关联的附加值。应用程序调用GetMessageExtraInfo以获取此额外信息。
创建时间:2021.06.28 更新时间: