Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

.net - How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del)

Is there Any way to handle the Ctrl+Alt+Del Key combination. Take for instance in a quiz application (Win Forms), the user should not be able to switch to other windows till the test is over.

I'm able to capture the Ctrl and Alt key strokes individually, using c# standard properties. but once they user hits the Del key . The control goes out of my appliation and windows handles it.

Any thoughts would be helpful.

thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Based on other answers, it seems that this is possible to do. Although I highly discourage this. Take for instance that your program should for some reason hang (god forbid...). Then you would have the situation that the only thing the user can do is to turn off the computer with the power button (or pull the plug...).

It is for a good reason that this is difficult to do, and the methods are poorly documented...

The only way this looks like the way to go, is the comment from Pierre-Alain Vigeant if this is a kiosk computer or something. Then it would actually make sense to do this!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...