码迷,mamicode.com
首页 > 其他好文 > 详细

C#控制鼠标位置

时间:2014-05-23 10:16:34      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:c   code   ext   a   int   set   

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.

C#控制鼠标位置,布布扣,bubuko.com

C#控制鼠标位置

标签:c   code   ext   a   int   set   

原文地址:http://www.cnblogs.com/xpvincent/p/3737519.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!