如何控制光标 [英] how to Control the cursor

查看:125
本文介绍了如何控制光标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功完成了简单查看器PC屏幕的代码.使用WP7
观看视频
http://www.youtube.com/watch?v=cCwsuj7Hcno [ ^ ]
现在,我将尝试尝试如何控制鼠标?
关于我的应用程序,我使用套接字连接到服务器,没有RDP协议,并且它的字眼很好.我可以在不同的机器和网络(@IP)上进行尝试,并且运行完美.

我的应用程序是去年的项目,因此有关如何控制光标的任何想法.

Hi I succeed to finish my code of simple viewer PC screen. Work with WP7
See the video
http://www.youtube.com/watch?v=cCwsuj7Hcno[^]
Now I will go to try how control the mouse?
About my app I use socket to connect to the server, no RDP protocol and its word good. I try it on different machines and networks (@IP) and work perfect.

My app is a last year project so any idea about how to control the cursor.

推荐答案

首先,您可以在System.Windows.Forms中控制光标.使用此类:
http://msdn.microsoft.com/en-us/library/system. windows.forms.cursor.aspx [ ^ ].

您还可以使用P/Invoked Windows API SendInput在整个系统的低级上控制光标.请参阅:
http://msdn.microsoft.com/zh-我们/library/windows/desktop/ms646310%28v=vs.85%29.aspx [ http://en.wikipedia.org/wiki/PInvoke [ http://msdn.microsoft.com/en-us/library/Aa712982 [ ^ ].

此CodeProject文章也很有用:
基本P/调用 [ http://www.pinvoke.net/default.aspx/user32.sendinput [ ^ ].

—SA
First, you can control cursor in System.Windows.Forms. Use this class:
http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.aspx[^].

You can also control the cursor on low-level system-wide using the P/Invoked Windows API SendInput. Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^].

If you need to learn P/Invoke, read this:
http://en.wikipedia.org/wiki/PInvoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^].

This CodeProject article is also useful:
Essential P/Invoke[^].

However, this method is relatively easy to P/Invoke. Here this is already done for your. You only need to include this code in your C# project:
http://www.pinvoke.net/default.aspx/user32.sendinput[^].

—SA


这篇关于如何控制光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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