Click here to Skip to main content
13,193,442 members (45,468 online)
Rate this:
 
Please Sign up or sign in to vote.
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);
 
        }


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??
Posted 17-Dec-12 1:41am
Updated 17-Dec-12 2:04am
v2
Comments
Tarun Y Mangukiya 18-Dec-12 0:40am
   
I gave the same answer...
Hetal Jariwala 18-Dec-12 1:30am
   
ok???
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Have you tried Keyboard and Mouse hook?

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

Thanks.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Please read the link How can I block keyboard and mouse input in C#?[^].

This will help.
  Permalink  
v2
Comments
Hetal Jariwala 18-Dec-12 0:33am
   
tnx
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

Refer this link...

disable mouse click event system wide using C#?

this may help you.

Thanks
  Permalink  
Comments
Hetal Jariwala 18-Dec-12 0:33am
   
tnx
Armando Talex 18-Dec-12 4:23am
   
Yours welcome...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web03 | 2.8.171018.2 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100