DesqView Awareness

 BBS: Inland Empire Archive
Date: 06-10-92 (16:48)             Number: 200
From: QUINN TYLER JACKSON          Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: DesqView Awareness             Conf: (2) Quik_Bas
Here is a program that will detect if it is running under DESQview.
Have fun with it.

___ CUT HERE ---

DECLARE SUB qjDVINIT ()
DECLARE FUNCTION qjDVINST% ()

'  QJDV.BAS v1.0 Released into the Public Domain
'  Written by Quinn Tyler Jackson

'$INCLUDE: 'qb.BI'

DEFINT A-Z

CONST TRUE = -1
CONST FALSE = NOT TRUE

DIM SHARED InRegs AS RegTypeX
DIM SHARED OutRegs AS RegTypeX

' The code that follows is merely a test.  To make this program into
' a support module, you must erase this silly code.

qjDVINIT
CLS
PRINT "Hello, and welcome to QJDV version 1.0"
PRINT

IF qjDVINST THEN
        PRINT "This test is running under DESQView"
        END
ELSE
        PRINT "This test is not running under DESQview...."
        END
END IF
END

SUB qjDVINIT
nul = qjDVINST
END SUB

FUNCTION qjDVINST
SHARED IN.DV
     InRegs.AX = &H2B01
     InRegs.cx = &H4445
     InRegs.dx = &H5351
     CALL InterruptX(&H21, InRegs, OutRegs)
     IF OutRegs.AX MOD 256 <> &HFF THEN
        IN.DV = TRUE
        ELSE IN.DV = FALSE
     END IF
qjDVINST = IN.DV
END FUNCTION


 * SLMR 2.1a * He'd the habit of putting things off until his next life.

--- Maximus/2 2.01wb
 * Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET