|
-
Dec 9th, 2005, 02:31 PM
#1
Thread Starter
Junior Member
how can i disable keyboard?????? please help
wish that anyone can help me in this, im working on administration project, and i need to lock the client keyboard, specially viewing Task manager, can please anyone tell me how to disable it????? please i dont have enough time
-
Dec 9th, 2005, 02:46 PM
#2
Junior Member
Re: how can i disable keyboard?????? please help
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
--
The BlockInput function blocks keyboard and mouse input events from reaching applications.
---
· fBlock
[in] Specifies the function's purpose. If this parameter is TRUE, keyboard and mouse input events are blocked. If this parameter is FALSE, keyboard and mouse events are unblocked. Note that only the thread that blocked input can successfully unblock input.
U`ll Never Get To HEAVEN If U`re Scared Of Gettin` HIGH
-
Dec 10th, 2005, 02:10 AM
#3
Thread Starter
Junior Member
Re: how can i disable keyboard?????? please help
i didnt got it
can you please post a small example on it???? many thanks
-
Dec 10th, 2005, 04:03 PM
#4
Fanatic Member
Re: how can i disable keyboard?????? please help
VB Code:
Option Explicit
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Private Sub Command1_Click()
fBlock (True)
End Sub
-
Dec 10th, 2005, 04:50 PM
#5
Thread Starter
Junior Member
Re: how can i disable keyboard?????? please help
"Option" is not declared, how can i decleare it???
-
Dec 10th, 2005, 04:55 PM
#6
Re: how can i disable keyboard?????? please help
Just paste these two lines before any subs
VB Code:
Option Explicit
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Option Explicit tells the IDE that you will declare each variable before you use it. It prevents spelling errors in your code. You can check Require Variable Declaration in the Options page, to have the IDE automatically place it in each form, module, and class. It is highly recommended that you enable this options. It will save you a lot of grief, and get you into good coding habits.
-
Nov 20th, 2008, 01:00 PM
#7
New Member
Re: how can i disable keyboard?????? please help
Hello. Im trying to do the same as them. My skills are not as good as yours, but I have a problem. I have to make a program, which can block the keyboard?
Which codes would you use?
-
Dec 19th, 2008, 11:18 AM
#8
Lively Member
Re: how can i disable keyboard?????? please help
Cant simply do something like this?
Code:
Private Declare Function GetAsyncKeyState Lib "user32" _
(ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
Dim KeyResult As Integer
Dim i As Byte
For i = 1 To 254
KeyResult = GetAsyncKeyState(i)
If KeyResult = -32767 Then
If i < 255 Then
MsgBox "apple"
Else
End If
End If
Next
End Sub
http://www.vbforums.com/showthread.php?t=550216
Last edited by Pezster; Dec 19th, 2008 at 11:25 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|