Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock User Input Windows XP

Status
Not open for further replies.

bamber123123

Programmer
Jan 31, 2005
7
GB
There is a program in schools called RM Tutor 2 (based on NetOp) where the teachers can freeze student's screens. This also 'locks' their keyboard and mouse.

The point of that was just to show this task is possible. I am looking to lock the keyboard and mouse on a local machine using VB6 (or failing that, VBScript?) for a given amount of time. I have been looking on the internet for months, but couldn't find a solution for VB6 anywhere.

If possible, during this 'freeze' period, i would like to be able to have another program/web page open, and close at the end of the set period. It also needs to lock CTRL+ALT+DEL, CTRL+SHIFT+ESC, ALT+F4, ALT+TAB etc

I am looking for a way of 'locking' or disabling the keyboard and mouse, not freezing the computer, (eg, repeateldy sending CTRL+ESC).

Any help is greatly appreciated, (note: this is for Windows XP [pro]) - and doesn't need to work on 98,95,me,etc

thanks in advance
bamber123123
 
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long

will block input from everything except for CTRL+ALT+DEL. There isn't an 'easy' way from blocking from blocking the SAS on NT based machines. Do a search for GINA on this forum and you can read some discussion on the documented ways of blocking the SAS (secure attention sequence, a.k.a CTRL+ALT+DEL)

 
>I have been looking on the internet for months

Can't have been looking all that hard ;-) ... simply typing

lock mouse keyboard XP

into Google, and the very first hit gives the same solution as bjd4jc's

And doing a keyword search in this very forum for 'lock input' would have got you to thread222-895439, in which I mention the same solution.

Have fun
 
this is not suited for the job, because, firstly:
"rundll32 keyboard,disable" doesnt work for xp
and the other API method doesnt disable CTRL+ALT+DEL. I have come across this solution many times, but it is wrong for the purpose.

I have found a way now, but its seperated into 2 forms and 3 modules, so its too large to post. There is NO way of getting out of it (with the exception of shutting down). Hitting CTRL+ALT+DEL three times rapidly will bring up the task manager, but the input stays locked, so nothing can be done with it. Another slight problem is that the windows key is perminantely blocked, and there are no foreign processes running. Windows is a mystery

Thanks for your help (i think),
bamber123123
 
could you point to a link of where you got the code, as I am interested!
 
ok, the block mouse&keyboard came (origionally) from:


i then added code from somewhere else (forgot where), loads of my own code, and i had an automated lock screen!

I have already made a file which lets me execute code on a remote computer, so i will re-create that to use here to block/unblock user input. At the moment, it is a 20 second timeout. I have uploaded the file here:
Please read that web page for more information


origional idea still comes from RM Tutor 2, and by replacing th bmp with the RM one, you cant tell the difference (except by pressing CTRL+ALT+DEL (flashes task manager)


Thanks for the help
bamber123123

PS. Searching google for 'Block' rather than 'lock' input gives better results :)
 
Oh, now you've rattled my cage ...

>"rundll32 keyboard,disable" doesnt work for xp

Who suggested that it did? You have bizarrely completely failed to read what I said. Which was to fully support BlockInput as the required solution.

And please don't even begin to think that the PSC solution actually disables CTRL-ALT-DEL.

1) It doesn't; it merely closes task manager (simply renaming the task manager window will allow it to work as normal ...)
2) It is a BlockInput solution (which, as we have already said, is what you need to be looking at)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top