Disable the Comination Keys Strokes in C#

S

Sundar

Hello ALL,

I want some help on

How to Disable the Combination Keys stokes like ALT+CTRL+DEL, ALT+TAB or any
other Combination using C#.

Hope for your response.
 
F

Family Tree Mike

There are ways to do this in an application, but you shouldn't. Imagine if
you opened MS Word and you expected to be able to switch to Internet
Explorer with Alt-Tab. You probably would not like it.
 
J

jp2msft

Mike,

Imagine having Machines out on the floor and an application you wrote keeps
someone from accidentally getting killed.

The employee running it is paid as little as the company can get away with,
and he has very few skills other than knowing how to kill your program with
CTRL-ALT-DEL or finding a way to browse to some games using ALT-TAB to access
anything else that happens to be running. Now he is surfing the 'net, playing
cards, or whatever, cuts his arm off because he wasn't paying attention, and
the company comes to you because they were using software that you wrote.

Sundar: I do not know how to disable this feature, but I will watch it
because I want to know as well. Hopefully, someone that knows how will chime
in. I know your Administrator can enable this feature, but if your
Administrator is like ours, he isn't very friendly when it comes to this.

Family Tree Mike said:
There are ways to do this in an application, but you shouldn't. Imagine if
you opened MS Word and you expected to be able to switch to Internet
Explorer with Alt-Tab. You probably would not like it.
 
F

Family Tree Mike

Here are two previous discussions on the VB.Net side. The logic applies to
the problem rather than the specific language (vb vs. c#).

http://www.microsoft.com/communitie...a75d&mid=12e9abad-0195-4d62-8892-b9ea1c08a75d

http://www.microsoft.com/communitie...26f5&mid=97a77760-4e2e-48d8-951b-5945880726f5

jp2msft said:
Mike,

Imagine having Machines out on the floor and an application you wrote
keeps
someone from accidentally getting killed.

The employee running it is paid as little as the company can get away
with,
and he has very few skills other than knowing how to kill your program
with
CTRL-ALT-DEL or finding a way to browse to some games using ALT-TAB to
access
anything else that happens to be running. Now he is surfing the 'net,
playing
cards, or whatever, cuts his arm off because he wasn't paying attention,
and
the company comes to you because they were using software that you wrote.

Sundar: I do not know how to disable this feature, but I will watch it
because I want to know as well. Hopefully, someone that knows how will
chime
in. I know your Administrator can enable this feature, but if your
Administrator is like ours, he isn't very friendly when it comes to this.
 
J

jp2msft

I'd love to forward your message to my managers and VPs here, but I know they
would not read it and it would likely result in my unemployment. :)

Peter Duniho said:
Imagine having Machines out on the floor and an application you wrote
keeps
someone from accidentally getting killed. [...]

All due respect, if you've got a machine that keeps someone from getting
killed, Windows isn't the right operating system. Neither is Linux, Mac
OS, or Unix for that matter.

For less critical applications, but where it's still important to keep
users from meddling, there are certain techniques that apply. But they
generally involve not giving the user access to the application (the
critical parts run as a service, for example) or to the input device (not
providing a keyboard, for example). The Ctrl-Alt-Del combination is
particular difficult-to-impossible to block in software, because it has a
very special, high-priority-override meaning in Windows. If Windows
provided an approved mechanism for disabling or otherwise diverting that
key combination, it could cause serious security issues when that
mechanism was used by malicious software.

Some of the other combinations might be interceptable by keyboard hooks or
the like, but even there one should tread cautiously. It's practically
never the correct solution for one application to hijack the operating
system's normal UI behavior.

Pete
 
K

Ken Foskey

It is actually very easy to remove Ctrl-Alt-Del from Linux for reboot.
You can even remove the Power switch monitor.

One way to manage killing applications is to have another process monitor
the first and restart it if it fails.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top