来自c#的Disble Keybord / Mouse [英] Disble Keybord/Mouse from c#

查看:119
本文介绍了来自c#的Disble Keybord / Mouse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序中在系统级别的特定时间段内禁用键盘/鼠标或两者。



我有以下操作

I need to disable keyboard/mouse or both for specific time period at system level in my application.

I have following to do that

public partial class NativeMethods
        {

            /// Return Type: BOOL->int
            ///fBlockIt: BOOL->int
            [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "BlockInput")]
            [return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
            public static extern bool BlockInput([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] bool fBlockIt);

        }





通过此代码,任务完成但用户点击CTRL + ALT + DELETE键盘和鼠标再次工作。

任何人都可以告诉我如何阻止它吗?



By this code the task is complete but when user click on CTRL+ALT+DELETE keyboard and mouse are working again.
Can any body tell me how to stop this??

推荐答案

你试过键盘和鼠标挂钩吗?



但我认为你不能停止使用CTRL + ALT + DELETE。

这是普遍的...



谢谢。
Have you tried Keyboard and Mouse hook?

But I think that you can''t stop using CTRL+ALT+DELETE.
It''s universal...

Thanks.


请阅读链接如何在C#中阻止键盘和鼠标输入? [ ^ ]。



这会有所帮助。
Please read the link How can I block keyboard and mouse input in C#?[^].

This will help.


您好,



请参阅此链接...



使用C#禁用鼠标点击事件系统?



这可能对你有帮助。



谢谢
Hi,

Refer this link...

disable mouse click event system wide using C#?

this may help you.

Thanks


这篇关于来自c#的Disble Keybord / Mouse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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