borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to change default of windows(date,format number))Next Topic (Send and Retrieve sms using GPRS Modem) New Topic New Poll Post Reply
AndreaVB Forum : API : how to disable and renable..?? Solved Topic
Poster Message
elric
Level: Scholar


Registered: 09-07-2006
Posts: 35

icon how to disable and renable..??

how could i disable and renable a mouse and keyboard with a time limit...?? lets say i want to disable my keyboard when im away for about 3 minutes or so.. after 3 minutes it will be enabled again.. could anyone help me on this..??   

____________________________
-same thing over and over again..-

31-07-2006 at 05:20 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: how to disable and renable..??

Hi,
Here u go :


Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
    DoEvents
    'block mouse n keyboard input
    BlockInput True
    'wait 10 seconds before unblocking it
    Sleep 10000
    'unblock mouse n keyboard input
    BlockInput False
End Sub


Alternatively, u can use the timer control...

ENJOY

Regards

____________________________
lOsT...

31-07-2006 at 09:45 AM
View Profile Send Email to User Show All Posts | Quote Reply
elric
Level: Scholar


Registered: 09-07-2006
Posts: 35
icon Re: how to disable and renable..??

oh tnk u bro..     

____________________________
-same thing over and over again..-

31-07-2006 at 12:10 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : how to disable and renable..?? Solved Topic
Previous Topic (How to change default of windows(date,format number))Next Topic (Send and Retrieve sms using GPRS Modem) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder