My site has been moved!

You should be automatically redirected in 6 seconds. If not, visit
http://www.hackagenius.co.cc
and update your bookmarks.




Lock Keyboard & Mouse

Posted by smit sanghvi Monday, November 2, 2009


                        

    Following Code will lock the Keyboard and Mouse Using Send Keys function.Just compile it in VB.NET. You must have this in order to use the SendKeys function Imports System.Windows.Forms Public Class WinControl ‘ This is the function used in order to block the keyboard and mouse: Declare Function BlockInput Lib “User32″ _ (ByVal fBlockIt As Boolean) As Boolean ‘ This function will block the keyboard and mouse untill a window with ‘ the specify caption will appear or the given time in seconds has ‘ past ( 0 seconds – wait forever). ‘ If the window with the caption appears than the given key is send ‘ to it and the input block is removed. Public Shared Function Wait2Send(ByVal caption As String, _ ByVal keys As String, ByVal seconds As Integer) ‘ Indicates if the window with the given caption was found Dim success As Boolean = False ‘ Start time of the function Dim now As DateTime = DateTime.Now ‘ Begining of keyboard and mouse block BlockInput(True) While (success = False And (DateTime.Now.Subtract(now).Seconds _

0 comments

Post a Comment

Visit our new website

Our Newsletter

Enter your email address To Subscribe Us Via Email:

Our SMS Updates