本文介绍了在没有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);来源: www.pinvoke/default.aspx/user32.setcursorpos
更多推荐
在没有System.Windows.Forms的情况下设置鼠标位置
发布评论