*--*  05/08/93  -  22:58:45  *--*

Date: 6:52 pm  Thu May 6, 1993         Number : 12 of 13
From: Hacker                           Base   : Pascal
To  : Viper                            Refer #: 9
Subj: Re: Pascal Experts Out There     Replies: None
Stat: Sent                             Origin : Local

Vi>     I need to know how to disable the CTRL-BREAK key and the CTRL-C key.
ok, When you press CTRL-BREAK (or CTRL-C for that matter), the CTRL-Break 
interrupt is called.. This interrupt is 1Bh, so if we want to stop the 
CTRL-BREAK from stopping the program, all we have to do is re-write the 
CTRL-Break handler...

program nobreak;
uses dos;
const
  BreakHit:Boolean = false;
var
  OldBreak:Procedure;  {We'll save the old CTRLBREAK routine here}
procedure MyBreak; interrupt;
begin
  Inline($9C);  {PUSH Flags... Don't know why, but It's good practice}
  BreakHit:=True;
end;
begin
 Press [enter] for more...                                 GetIntVec($1B,@OldBreak);      {Get the old one}
  SetIntVec($1B,Addr(MyBreak));  {Set the new one}
  repeat
    if breakhit then              {Did they hit CTRL-BREAK?}
    begin
      breakhit:=false;            {Reset the flag}
      writeln('HAHA, you can''t stop this program!!!');
    end;
  until false;   {IE. Forever}
  SetIntVec($1B,@OldBreak);       {Reset the old handler.. REMEMBER THIS!}
                                  {It's sort of redundant since this program
                                  can't be stopped, but it is neccessary}
end.


THere you go... That should work nicely. 

--- Renegade v04-16 Beta
 * Origin: The Programmer's Coalition v.32bis (416)648-9951 (49:49/0)

[2: Pascal]
Reading Message 12 of 13 (?=help): 