使用Cursor.Position,SetCursorPos(),SendInput()和mouse_event()有什么区别? [英] What's the difference between using Cursor.Position, SetCursorPos(), SendInput() and mouse_event()?
问题描述
Cursor.Position,SetCursorPos(),SendInput()和mouse_event()都将鼠标位置设置为指定的坐标。
Cursor.Position, SetCursorPos(), SendInput() and mouse_event() all set the mouse position to a specified coordinate.
那么它们之间有什么区别?
So what's the difference between them?
推荐答案
-
Cursor.Position
和SetCursorPos
只能用于更改光标位置。Cursor.Position
是Windows窗体;SetCursorPos
是Win32。Cursor.Position
andSetCursorPos
can only be used to change the cursor position.Cursor.Position
is Windows Forms;SetCursorPos
is Win32.SendInput
和mouse_event
可以用于更改光标位置以及生成鼠标点击和鼠标滚轮事件。SendInput
是当前的API;除了生成鼠标事件,它还可以生成键盘输入。mouse_event
是早期的,已弃用的API。SendInput
andmouse_event
can be used to change the cursor position as well as generate mouse clicks and mouse wheel events.SendInput
is the current API; in addition to generating mouse events, it can also generate keyboard input.mouse_event
is an earlier, deprecated API.这篇关于使用Cursor.Position,SetCursorPos(),SendInput()和mouse_event()有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!