[comp.lang.pascal] Activate an TSR.

dvlhma@cs.umu.se (Henrik Magnusson) (03/25/91)

Hello!
I have just started to write an TSR. I haven't written any TSRs before so I
have a question about it. 
How do I activate the TSR if a speciall key is pressed, ex ESC.

Another question (not about TSR)!
Does anyone have an idea about how i can change the textstring on the command-
line. For example:
The user has entered the following:
dir hello
But the program shall change the command-line before ist executed to
dir byebye

Is it possible to do anything like that????

/Henrik Magnusson

dave@tygra.UUCP (David Conrad) (03/27/91)

In article <1991Mar24.192416.9521@cs.umu.se> dvlhma@cs.umu.se (Henrik Magnusson) writes:
>Hello!
>I have just started to write an TSR. I haven't written any TSRs before so I
>have a question about it. 
>How do I activate the TSR if a speciall key is pressed, ex ESC.
>
Intercept Interrupt $9 or $16 is the short answer.  The long answer is about
20 pages.  This is a very complex thing.  Very very complex.

>Another question (not about TSR)!
>Does anyone have an idea about how i can change the textstring on the command-
>line. For example:
>The user has entered the following:
>dir hello
>But the program shall change the command-line before ist executed to
>dir byebye
>
Actually, that is a TSR question.  The solution is to intercept interrupt
$21 function $0A (buffered string input) which DOS calls to get a line of
text from the user after the prompt.  You can then fudge around with it
all you like before returning it to COMMAND.COM.  This is, in fact, how
the popular DOSEDIT (or NDOSEDIT) TSR programs do their aliasing.

You should get The Waite Group's MS-DOS Papers, Ray Duncan's Advanced
MS-DOS Programming, Ralf Brown's Interrupt List (INTER291.ZIP from
SIMTEL20.ARMY.MIL's PD1:<MSDOS.INFO> directory) before attempting
TSR's.  Also, it's easier, IMHO, to write them in Assembly Language.

Dave Conrad
sharkey!tygra!dave
-- 
=  CAT-TALK Conferencing Network, Computer Conferencing and File Archive  =
-  1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new'    - 
=  as a login id.  AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET")        =
   E-MAIL Address: dave%tygra@sharkey.cc.umich.edu