[comp.sys.ibm.pc] Check if ANSI.SYS driver is loaded.

aruit@idca.tds.PHILIPS.nl (A. de Ruiter) (11/16/89)

Is there anybody out there who knows how you can check from out a user program
if the ANSI.SYS driver is loaded.  In a c/assembler program I frequently use
several ANSI escape sequences to write certain information to the display.  In
case the ANSI.SYS driver of MS-DOS is not loaded from config.sys, the output
on the display looks terrible.  Now I want to check in the beginning of my
program if the ANSI.SYS driver is running or not.  In that way I can give an
error message to inform the user to load the driver first before restarting the
program.

Please if you have suggestions and/or c/assemble sources send them to me.
I use MSC5.1, MASM5.1 and CTOOLS+5.0 for the development of this program.

--------------------------------------------------------------------------------
  _                       __            |Anton de Ruiter
 /_| __ /_ _  __  __/_   /__)   ./_ _  _|Philips TDS, Department OA&T
/  |/ /(_ (_)/ / (_/(-' / \ (_//(_ (-'/ |P.O. Box 245
     __                ____ __   ___    |7300 AE  Apeldoorn, The Netherlands
    /__)/_ ./  ._  _    /  /  \ /___    |Internet: aruit@idca.tds.philips.nl
   /   / //(_ //_)/_)  /  /___/ ___/    |UUCP    : ..!mcvax!philapd!aruit
              /                         |Phone   : +31 55 433514
--------------------------------------------------------------------------------

fisher@sc2a.unige.ch (Markus Fischer) (11/28/89)

In article <622@ssp16.idca.tds.philips.nl>, aruit@idca.tds.PHILIPS.nl (A. de Ruiter) writes:
> Is there anybody out there who knows how you can check from out a user program
> if the ANSI.SYS driver is loaded.

It seems one way to do this is to send a Device Status Report (DSR) sequence,
and to check whether the Cursor Position Report (CPR) has arrived on stdin...

i.e., send a "\0x1b[6n", and read a "\0x1b[%d;%dR", line, column.  There is
little chance that the user will type in exactly that at the right time, don't
you think ?

Markus Fischer                -|--|--|--|--|--|--I   Department of Anthropology
                        -|--|--|--|--|--|--|-(#)-I   University of Geneva
      -|--|--|--|--|--|--|--|--|-(#)-|-(#)(#)(_)-I   CH-1227  Carouge (GE)
   -&-(_)-|--|--|-(#)-&--|-(#)(#)(_)(#)-&-(_)(#)-I   Switzerland
            -|--|--|--|--|-(#)(_)-|-(_)(_)(_)(#)-I
black (#) to kill ! --|--|-(#)(_)(_)(_)(#)(#)(_)(_)  fisher@sc2a.unige.ch
=+==+==+==+==+==+==+==+==+==+==+==+==+==+==+=(#)=+   fisher@cgeuge52.bitnet