472,958 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 2251
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dw70 | last post by:
I need write simple program with work in background and have only one function when it is run F1 I disable and when I pres for example ctrl+k it (program is terminate) maybe somebody have...
5
by: LisaConsult | last post by:
We upgraded a vb project to vb.net and added many enhancements. The old project was not an MDI and used buttons for functions like adding a record (Alt A), deleteing a record etc. This is a data...
16
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
3
by: vanya | last post by:
i have been tryin to program(javascript) to disable the following keystroke combinations CTRL+O or CTRL+L Go to a new location (O = 79 L = 76) CTRL+S Save the current page ( S = 83) CTRL+E...
2
by: ApexData | last post by:
Hello In order to control keyboard keystrokes in my application, I use the KeyPreview=Yes, OnKeyDown Events of every Form with great success. HOWEVER, these events are not available in REPORTS,...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
5
WebDunce
by: WebDunce | last post by:
hey all, i'm building a custom control. it contains a treeview and a context menu. each tree node's context menu property is set to the control's context menu. it works good...except... if...
16
by: nagmvs | last post by:
Hi, Can any one tell me How to disable Keyboard Functions using JavaScript.If knows please tell me the code.Also tell me the code for mouse disable also. Thanks, Nagesh.
11
by: shadyabhi | last post by:
How can i accept key strokes like Ctrl+A etc etc ... i mean combination of 2 keys... Pls give a small peice of code to demonstrate... i use gcc under linux platform
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.