Win95/98 checking and reporting 
Author Message
 Win95/98 checking and reporting

I have some source code here but I cannot find how to detect what Windows
evrsion a program is using.

when running win98/95 the program only reports "Windows" and not Windows 95
etc

could someone help

{IFDEF OVERLAY}
  {O+F+}
{ENDIF}

unit prottask;
interface

uses
     Dos,
     crt,
     mcmtypes,
     h_timers;

Const

  MDOS  = 0;  { DOS               }
  OS2   = 1;  { OS/2 is installed }
  WIN   = 2;  { Windoze           }
  DV    = 3;  { DesqView          }
  DDOS  = 4;  { DoubleDOS         }
  TVIEW = 5;  { TopView           }
  PCMOS = 6;  { PC-MOS/386        }
  WIN95 = 7;  { Windows 95        }

  MTasker : array[0..7] of s10 = (
                                  'Plain DOS',
                                  'OS/2',
                                  'Windows',
                                  'Desqview',
                                  'DoubleDOS',
                                  'TopView',
                                  'PC-MOS/386',
                                  'Windows 95'
                                 );

  tim : longint = 0;
  ipx : byte = 0;
  env : boolean = false;
  Ops : Byte = 0;    { Operating System OS/2/DOS/WIN/DV}

PROCEDURE giveawaytime;

IMPLEMENTATION

PROCEDURE giveawaytime;
begin
  asm

    CMP ops,MDos  { Compare to DOS }

    CMP ops,Dv    { Compare to Desqview }

    CMP ops, Win  { Compare to Windows }

    CMP ops, Win95{ Compare to Windows }

    CMP ops, OS2  { Compart OS/2 }

    CMP ops, DDOS { Compart DoubleDos }

    CMP ops,TVIEW { Compart TaskView }

    CMP ops,PCMOS { Compart PC-MOS/386 }



(*    INT 28h      { Interupt 28h }*)


    MOV ax,1000h { AX = 1000h }
    INT 15h      { Call Interupt 15h }


    MOV AX,1680h { AX = 1680h}
    INT 2Fh      { Call Interupt 2Fh for Win-OS/2 TimeSlice }


    STI
    HLT


    mov AX,$EE01
    int $21


    MOV ax,1000h { AX = 1000h }
    INT 15h      { Call Interupt 15h }


    MOV ax,1000h { AX = 1000h }
    INT 15h      { Call Interupt 15h }


  end;

end; {GiveSlice}

PROCEDURE checkos; Assembler;
{ Currently Supports DesqView, Microsoft Windows and IBM's OS/2 }

asm
  mov ops, MDos { Default DOS }
  mov ah, 30h   { AH = 30h }
  int 21h       { dos version }
  cmp al, 14h

(*
  mov ax,3000h
  mov cx,3000h
  mov dx,3000h
  mov bx,3000h
  int 21h       { PC-MOS Installed? }
  cmp ax, 0

*)
  mov ax,2B01h
  mov cx,4445h
  mov dx,5351h
  int 21h       { Desqview Installed? }
  cmp al, 255

  mov ax,160Ah
  int 2Fh       { Windows Install?}
  cmp ax, 0h



  mov Ops, Os2  { Set OS Value }


  mov ops, Dv   { Set OS Value }


  mov ops, DDOS { Set OS Value }


  cmp bh , 4h

  mov ops, win  { Set OS Value }


  mov ops, win95  { Set OS Value }


  mov ops, PCMOS{ Set OS Value }


end; { checkos }

begin
  checkos;
end.

--
Regards LuK



Wed, 18 Jun 1902 08:00:00 GMT  
 Win95/98 checking and reporting

Quote:

>I have some source code here but I cannot find how to detect what Windows
>evrsion a program is using.

>when running win98/95 the program only reports "Windows" and not Windows 95
>etc

You could read from the environment the Windows OS version.  I don't
remember offhand what the environment variable is.  You could also do
a shell to DOS and run the 'ver' command and return the text it
reports:

i.e.  ver > version.txt

I don't know of any other DOS/API calls to get the windows version.

Good luck,

Mike McWhinney
Chief Engineer
elja, Inc.



Wed, 18 Jun 1902 08:00:00 GMT  
 Win95/98 checking and reporting
LuK schrieb:

Quote:
> I have some source code here but I cannot find how to detect what Windows
> evrsion a program is using.

> when running win98/95 the program only reports "Windows" and not Windows 95
> etc

INT 2F - MS Windows 3.1 - IDENTIFY WINDOWS VERSION AND TYPE
        AX = 160Ah
Return: AX = 0000h if call supported
            BX = version (BH=major, BL=minor)
            CX = mode (0002h = standard, 0003h = enhanced)

  procedure GetWinVer(var Mayor, Minor, Mode : Byte); Assembler;
  asm
    mov     ax, 160Ah
    int     2fh
    or      ax, ax

    {-Call is not supported, zero results}
    xor     bx, bx

    {-Return mayor version}
    mov     al, bh
    les     di, Mayor
    stosb
    {-Return minor version}
    mov     al, bl
    les     di, Minor
    stosb
    {-Return mode}
    mov     al, cl
    les     di, Mode
    stosb
  end;

var
  Mayor, Minor, Mode : Byte;
begin
  GetWinVer(Mayor, Minor, Mode);
  WriteLn('Windows95a returns version 3.95 mode 3');
  WriteLn('Windows98b returns version 4.10 mode 3');
  WriteLn('Version ', Mayor, '.', Minor, ' Mode ', Mode);
end.

By, Andreas.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Win95/98 checking and reporting

2. extend borland pascal to long filenames and use of win95/98/me/xp filedialogs

3. Rotate/Flip a Metafile [Win95/98] ?

4. Win95/98 and D3-Paradox

5. Establish Dial-Up connection in WIN95/98 from TP

6. Turbo Pascal 1.5 with Win95/98

7. Turbo Pascal 1.5 with Win95/98

8. Q: Checking entries and reporting key violation

9. Spell checking reports???

10. Windows 95/98 Version Checking. . .

11. Report Smith caunt see my ODBC Watcom Database using win95

12. How does Microsoft calculate the Window Heading font in Win95/98???

 

 
Powered by phpBB® Forum Software