BBS: Inland Empire Archive Date: 08-31-92 (06:24) Number: 27 From: QUINN TYLER JACKSON Refer#: NONE To: ZACK JONES Recvd: NO Subj: DesqView Version FUNCTION Conf: (2) Quik_Bas
' You asked for it....
' Programmed it today and tested as fully operational under DesqView V2.26
DECLARE FUNCTION DesqView! ()
' This module must include the INTERRUPTX routine
' $INCLUDE: 'd:\inc\qb.bi'
DIM SHARED InRegs AS RegTypeX
DIM SHARED outregs AS RegTypeX
' This code is just for testing the logic of the FUNCTION
CLS
IF DesqView THEN
PRINT "Running under DesqView Version"; DesqView; "!"
ELSE
PRINT "Not running under DesqView."
END IF
DEFINT A-Z
'******************************DesqView*********************************
'* This function returns FALSE if a program is not running under the *
'* DESQview environment, otherwise it returns the DV version number. *
'***********************************************************************
FUNCTION DesqView!
InRegs.ax = &H2B01 'DOS time service
InRegs.cx = &H4445 'Set CX to 'DE'
InRegs.dx = &H5351 'Set DX to 'SQ'
' DOS service call
CALL INTERRUPTX(&H21, InRegs, outregs)
' If DOS does not recognize 'DESQ' as bad, then in DV
IF outregs.ax MOD 256 <> &HFF THEN
MajorVersion! = outregs.bx \ 256 'BH =Major Version
MinorVersion! = (outregs.bx MOD 256) / 100 'BL =Minor Version
inDV! = MajorVersion! + MinorVersion!
' If 'DESQ' is bad date, then not in DV
ELSE
inDV! = FALSE
END IF
' Return SINGLE precision version number
DesqView! = inDV!
END FUNCTION
' Quinn
--- Maximus/2 2.01wb
* Origin: The Nibble's Roost, Richmond BC Canada 604-244-8009 (1:153/918)

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