471,318 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Disable the Comination Keys Strokes in C#

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.
--
Best Regards,
Sundar Shrestha
Aug 24 '08 #1
7 2178
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.

"Sundar" <Su****@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
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.
--
Best Regards,
Sundar Shrestha
Aug 24 '08 #2
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" wrote:
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.

"Sundar" <Su****@discussions.microsoft.comwrote in message
news:83**********************************@microsof t.com...
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.
--
Best Regards,
Sundar Shrestha

Aug 24 '08 #3
"Sundar" <Su****@discussions.microsoft.comwrote:
How to Disable the Combination Keys stokes like ALT+CTRL+DEL, ALT+TAB or
any other Combination using C#.
Ctrl+Alt+Del is reserved for the operating system. That's why pressing those
keys to log on to a workstation guarantees that you aren't typing your
password into a malicious replacement login program. You can't override it
without some very complicated stuff (look up "GINA") and certainly not with
C# code.

Eq.
Aug 24 '08 #4
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/communities...2-b9ea1c08a75d

http://www.microsoft.com/communities...b-5945880726f5

"jp2msft" <jp*****@discussions.microsoft.comwrote in message
news:74**********************************@microsof t.com...
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" wrote:
>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.

"Sundar" <Su****@discussions.microsoft.comwrote in message
news:83**********************************@microso ft.com...
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.
--
Best Regards,
Sundar Shrestha

Aug 24 '08 #5
On Sun, 24 Aug 2008 09:24:06 -0700, jp2msft
<jp*****@discussions.microsoft.comwrote:
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
Aug 24 '08 #6
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" wrote:
On Sun, 24 Aug 2008 09:24:06 -0700, jp2msft
<jp*****@discussions.microsoft.comwrote:
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
Aug 25 '08 #7

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.
Aug 25 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dw70 | last post: by
5 posts views Thread by LisaConsult | last post: by
2 posts views Thread by ApexData | last post: by
3 posts views Thread by MLM450 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.