在没有System.Windows.Forms的情况下设置鼠标位置 [英] Setting mouse position without System.Windows.Forms

查看:148
本文介绍了在没有System.Windows.Forms的情况下设置鼠标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种无需使用System.Windows.Forms.Cursor即可操纵鼠标位置的方法?可能是互操作性吗?

Is there a way to manipulate the mouse position without using System.Windows.Forms.Cursor? Something like interop maybe?

原因是我们使用的是专用的.NET子集,其中不能包含System.Windows.Forms.

Reason for this is that we are using a specialized .NET subset which can't include System.Windows.Forms.

推荐答案

糟糕透了,阅读问题太快了,这是正确的PInvoke调用

oops my bad, read question too fast, heres the correct PInvoke call

[DllImport("user32.dll")]
static extern bool SetCursorPos(int X, int Y);

来源: http://www.pinvoke.net/default.aspx/user32.setcursorpos

这篇关于在没有System.Windows.Forms的情况下设置鼠标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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