座/废掉鼠标移动/单击C# [英] Block/Nullify mouse movement/click in C#

查看:103
本文介绍了座/废掉鼠标移动/单击C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个应用程序完全控制鼠标点击/移动。

I am writing an application to fully control the mouse click/movement.

举例来说,如果我有应用程序运行,形成完全透明,全屏,那么,如果我点击鼠标右键,在正常情况下,它会带来应用程序在后台焦点 - 我要阻止这种情况发生(即单击该按钮并没有什么明显的应该发生在屏幕上),因为我需要处理所有鼠标活动,使用此应用程序发送出去。

For instance, if I have the application running, form fully transparent, fullscreen, then if I click the mouse button, in normal case, it will bring the application in background in focus - I need to stop this from happening (i.e. clicking the button and nothing visible should happen on the screen), as I need to process all the mouse activity and send it out using this application.

我需要让2鼠标独立行动,而我用这作为一个覆盖,创建2假冒指针采用拉丝C#中,惠斯特禁用真正的鼠标

I need to allow 2 mouse to act independently, and I am using this as an overlay, creating 2 fake pointers by drawing using C#, whist disabling the real mouse.

推荐答案

什么你是指被称为鼠标捕获 - 而且这是可以做到它既Windows窗体以及WPF和WinAPI的直接。

What you are referring to is called mouse capture - and it can be done it both Windows Forms as well as WPF and WinAPI directly.

下面的的顺便做它的WinForms 的。

在WinAPI的水平,你可以使用 SetCapture(HWND W)的函数调用。

At the WinAPI level you can use the SetCapture( HWND w ) function call.

这篇关于座/废掉鼠标移动/单击C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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