Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.os.msdos.programmer FAQ part 2/5
Section - - How can I disable Ctrl-C/Ctrl-Break and/or Ctrl-Alt-Del?

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Forum archive ]


Top Document: comp.os.msdos.programmer FAQ part 2/5
Previous Document: - How can I find out whether a character has been typed, without waiting for one?
Next Document: - How can I disable the print screen function?
See reader questions & answers on this topic! - Help others by sharing your knowledge
Date: 5 Feb 2002 22:03:03 -0400

 Several utilities are downloadable from:
 <ftp://ftp.simtel.net/pub/simtelnet/msdos/keyboard/>

 In that directory, cadel.zip contains a TSR (with source code) to
 disable those keys. Also, keykill.arc contains two utilities:
 keykill.com lets you disable up to three keys of your choice, and
 deboot.com changes the boot key to leftShift-Alt-Del. C programmers who
 simply want to make sure that the user can't Ctrl-Break out of their
 program can use the ANSI-standard signal() function; the Borland
 compilers also offer ctrlbrk() for handling Ctrl-Break. However, if your
 program uses normal DOS input such as getch(), ^C will appear on the
 screen when the user presses Ctrl-C or Ctrl-Break. You can avoid the ^C
 echo for Ctrl-C by using _bios_keybrd() in MSC or bioskey() in BC++;
 however, Ctrl-Break will still terminate the program.

 An alternative approach involves programming input at a lower level. You
 can use INT 21 AH=7, which allows redirection but doesn't echo the ^C
 (or any other character, for that matter); or use INT 16 AH=0 or 10; or
 hook INT 9 to discard Ctrl-C and Ctrl-Break before the regular BIOS
 keyboard handler sees them; etc., etc.

 You should be aware that Ctrl-C and Ctrl-Break are processed quite
 differently internally. Ctrl-Break, like all keystrokes, is processed by
 the BIOS code at INT 9 as soon as the user presses the keys, even if
 earlier keys are still in the keyboard buffer: by default the handler at
 INT 1B is called. Ctrl-C is not special to the BIOS, nor is it special
 to DOS functions 6 and 7; it is special to DOS functions 1 and 8 when at
 the head of the keyboard buffer. You will need to make sure BREAK is OFF
 to prevent DOS polling the keyboard for Ctrl-C during non-keyboard
 operations.

 Some good general references are {Advanced MS-DOS} by Ray Duncan, ISBN
 1-55615-157-8; {8088 Assembler Language Programming: The IBM PC}, ISBN
 0-672-22024-5, by Willen & Krantz; and {COMPUTE!'s Mapping the IBM PC},
 ISBN 0-942386- 92-2.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




Top Document: comp.os.msdos.programmer FAQ part 2/5
Previous Document: - How can I find out whether a character has been typed, without waiting for one?
Next Document: - How can I disable the print screen function?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
jeffrey@carlyle.org (Jeffrey Carlyle)





Last Update March 27 2014 @ 02:11 PM