C#控制鼠标位置

It is not possible using the .NET BCL. However if you really want it you can use native SetCursorPos inUser32.dll.

[DllImport("User32.dll")]
private static extern bool SetCursorPos(int x, int y);

As others will most likely point out, you can achieve the same using System.Windows.Forms, however when developing a WPF application prefer use DllImport.

posted @ 2014-05-19 19:27  马语者  阅读(1460)  评论(0编辑  收藏  举报