使用Cursor.Position,SetCursorPos(),SendInput()和mouse_event()有什么区别? [英] What's the difference between using Cursor.Position, SetCursorPos(), SendInput() and mouse_event()?

查看:572
本文介绍了使用Cursor.Position,SetCursorPos(),SendInput()和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 and SetCursorPos 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 and mouse_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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆