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 2:41am
Edited 17-Dec-12 3: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 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
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