home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / DESQVIEW / TECH / DVA_TCPP.ZIP / DVGETVER.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-06  |  1.8 KB  |  49 lines

  1. /***************************************************************************\
  2. *
  3. *
  4. *   PROCEDURE         - Get Version
  5. *
  6. *   PURPOSE           - Returns the DESQview major/minor version numbers, and
  7. *                       sets the inDV flag to the same value.  The high byte
  8. *                       of the return value is the major version number, and
  9. *                       the low byte is the minor.
  10. *
  11. *
  12. *   GENERAL ALGORITHM - Call the DOS set date function with an invalid date
  13. *                       of 'DESQ'.  DESQview will respond to this if present.
  14. *
  15. *   INPUT             - none.
  16. *
  17. *   OUTPUT            - the DESQview API version number.
  18. *
  19. *   SYSTEM            - Borland's Turbo C++ v1.0 on an EPSON EQUITY III+
  20. *                       running MS-DOS v4.01 & DESQview v2.26.  Should operate
  21. *                       under any MS/PC-DOS 2.x or greater & DESQview 2.x or
  22. *                       greater.
  23. *
  24. *   HISTORY:
  25. *      90-07-28       - Initiated Mark Potter
  26. *
  27. \***************************************************************************/
  28.  
  29. #include <dos.h>
  30. #include "dvaware.h"
  31.  
  32. unsigned int dv_get_version(
  33.    void
  34. ) {
  35.    _CX = 0x4445; /* 'DE' */             // set CX to 4445H; DX to 5351H
  36.    _DX = 0x5351; /* 'SQ' */             // (an invalid date)
  37.    _AX = 0x2B01;                        // DOS' set data function
  38.    geninterrupt( 0x21 );                // call DOS
  39.    if ( _AL != 0xFF )                   // if DOS didn't see as invalid
  40.       _AX = _BX;                           // AH=major ver; AL=minor ver
  41.    else                                 // DOS saw as invalid
  42.       _AX = 0;                             // no desqview
  43.    inDV = _AX;                          // Save version in inDV flag
  44.    return _AX;                          // Return version number
  45. }
  46.  
  47. // END DVGETVER.CPP
  48. 
  49.