home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 3.ddi / EXAMPLES / WINDOWS / ISWIN3E.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-29  |  637 b   |  33 lines

  1. /* 
  2. ISWIN3E.C
  3. */
  4.  
  5. #include <stdlib.h> 
  6. #include <stdio.h> 
  7. #include <string.h> 
  8. #include <dos.h> 
  9. #include <pharlap.h>
  10.  
  11. int win3e(int *pmaj, int *pmin) 
  12.    SWI_REGS regs;
  13.  
  14.    memset(®s, 0, sizeof(regs));
  15.    regs.eax = 0x1600;
  16.    _dx_real_int(0x2f, ®s);
  17.    *pmaj = regs.eax & 0xff;
  18.    *pmin = (regs.eax >> 8) & 0xff;
  19.    return (*pmaj > 1 && *pmaj != 0x80);
  20.  
  21. main() 
  22.    int maj, min; 
  23.    if (! win3e(&maj, &min)) 
  24.       printf("Not running under Windows 3.x Enhanced mode\n"); 
  25.    else 
  26.       printf("Running under Windows %d.%d Enhanced mode\n",  
  27.             maj, min); 
  28.    return 0; 
  29.