Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows .NET Framework 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);
 
        }
 
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
Edited 17-Dec-12 2:04am
v2
Comments
Tarun Y Mangukiya at 18-Dec-12 0:40am
   
I gave the same answer...
Hetal Jariwala at 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 at 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 at 18-Dec-12 0:33am
   
tnx

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

  Print Answers RSS
0 OriginalGriff 339
1 Maciej Los 208
2 George Jonsson 144
3 Kornfeld Eliyahu Peter 139
4 Dave Kreskowiak 130


Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid