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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable keyboard 1

Status
Not open for further replies.

GCTIberica

Programmer
Jun 20, 2003
30
ES
Hi
Does anyone know how to do this? I hope there is a simple command, however I can´t seem to find anything

I want to temporarily disable a keyboard. I am using Windows 2000, and I realise it is very difficult and dangerous to disable CTRL+ALT+DEL

Is there any simple way to do this?

Thanks
 
I don't know, which leads me to the question - why?

Explain what you're doing and why you would like to disable the keyboard, and perhaps we can come up with an alternate solution for you.
 
OK
So I´ll explain why I have to disable keyboards!!!
My clients have a touch screen computers, on which they should only be able to access my program. However, some of them plug in keyboards and close my app and go on the internet, etc
Therefore I need to disable the keyboards!
 
hi

Is the internet access the only reason why you want to disable it? I believe it is possible to do, I just think it's a bit drastic and what if the app locks up, will you just turn the computer off and on again, and doing this, could it cause other problems (eg at the server end if it accesses one)?

Would it not be better to disable/remove internet access and any other non essential apps?

Please don't get annoyed with my reply, just thinking of things...

lou


 
Unfortunately no! If they even close the program, it causes major problems. And I have programs running in the background etc
They only way to do it is disable the keyboard!
However this seems to be a difficult task for 2000...
 
hi

Ok then. You can block the keyboard and the mouse - have a look at this link, you will have to register with the site, though. If you don't want to register, I did a search in Google for 'Delphi "disable keyboard"' and it return a lot of hits (including this one).


hope this helps
lou
 
Hi
Unfortunately I can´t block the mouse, as I am using touch screen input!!!!!!
 
Did you write the programs that shouldn't be closed? If so, then you could always have a crack at converting them to a service. Windows 2000 provides protection for services by not allowing non-administrators to stop them.

Admittedly, this is a pretty big effort. I think you're more likely to have success by getting a company policy authorised that prevents your users from doing what you don't want them to do. My experience has shown that users 'misbehave' when they're unaware of what their actions are causing to other systems. Perhaps it could be as simple as that.

From my perspective, surfing the internet is not a bad thing. It is non-productive for sure, but if they're getting their work done, then this is a moot point. If they're not getting their work done, then this is a problem for their supervisors. I think if you approached them with the attitude of 'can we get along' they would be far more likely to respect your program and leave it running while they did other things on the computer. That's my two cents anyhow.
 
Could look for internet programs with a timer and close them.

procedure TfrmMain.Timer_KillIETimer(Sender: TObject);
var
hIExplorer : THandle;
begin
hIExplorer := FindWindow('IEFrame', nil) ;
PostMessage(hIExplorer, WM_CLOSE, 0, 0) ;
end;



Are they closing it gracefully, or ctrl+alt+deleting? If they are doing it the polite way, you can put a canclose on the main screen, and password protect the close. I don't know if you can control the keyboard once the user switches to another program.

If your program is always the active window, you can probably do key intercepts.

procedure CMDialogKey(var Msg: TWMKey); message CM_DIALOGKEY;

procedure TForm1.CMDialogKey(var Msg: TWMKey);
begin
case Msg.CharCode of
VK_CTRL:
ShowMessage('You pressed my Tab key!');
end;
end;

or you could change the keyboard mapping to dvorak instead of qwerty?







Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
Thanks all
However, this still doesn´t really get around the problem I have! I can change the keyboard settings, I can disable the windows key...
I can´t however disable CTRL+ALT+DEL or even disable CTRL+ESC or ALT+TAB or ALT+F4
So if users have access to a keyboard, they can do what they like! I don´t know any way round this! :-(
 
Hello, this is my first answer here, I hope it helps :)

This code disable ALT+TAB and CTRL+ALT+DEL:
Code:
program disable;

uses
  WinProcs;

var
   Dummy : integer;

begin
  Dummy := 0;
  {Disable ALT-TAB}
  SystemParametersInfo( SPI_SETFASTTASKSWITCH, 1, @Dummy, 0);
  {Disable CTRL-ALT-DEL}
  SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @Dummy, 0);
end.
Note: If you want to reenable these functions, change the "1"s by "0"s.
 
You would also want to disable the start key, start + D, etc.
 
Hi Minions
Thanks for the help, but this doesn´t work for Win2000 or WinNT!
This task seems pretty impossible in W2K
 
Hi there,

just read your original message and I must say that I had a similar problem a couple years back in some really remote places in Africa, running an application on Windows NT.

Now Win2k and NT are pretty similar, at least as far as their administration is concerned. What you can do, is to create a user group under Win2K that contains all the users that need access to your software and the customize the desktop available to them. We have done this to the degree where the only thing they could do was start our application and terminate it (ok, I know you also want to prevent that, but these things you should be able to catch).

It worked pretty well in our case.

Hope this helps

wolfiesz
 
I think you're going around this the wrong way.

You really need to be locking Windows 2000 down and running the workstation in a kiosk mode. This can be done with local and group policies.

I have a site with 200+ locked down Windows 2000 Pro workstations. I manage everything from GPO in the domain.

Let Windows do all the hard work, that's what it's there for, then you only need to worry about the functionality of your program.

Stella

There are 10 types of people in the world. Those that understand binary and those that don't.
 
hi StellaIndigo
Thanks for your response. What exactly is Kiosk Mode though?

Thanks
 
Kiosk mode is a general term for running the system locked down running with limited applications and system access. Normally you might see kiosk machines in service motorway stations where you can send emails and browse the internet via a touch screen or keyboard/mouse.

My machines at work, depending on Group policy, allow users to access only a few applications. They can't run program, install applications, change the desktop/system, browse drives etc.

Search google with keywords: windows 2000 desktop lock down

Stella

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Oh, and/or cross post win2k lockdown info into the Windows 2000 Pro forum.

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top