🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1172

How to get the windows and DOS versions

#1172
From: �ϵ�
Date: Sun, 19 Apr 1998 00:00
49 lines
1935 bytes
������: njhe (heҪ�Ʋ�), ����: RAD
��  ��:  How to get the windows and DOS versions.
����վ: '3m�Ͻ�ɺ�m' (Mon Mar  9 18:07:51 1998) , վ���ż�

     Product: Delphi
     Version: 1.0
     Platform: Windows



Q:  How can I get the Windows or DOS version numbers?

A:  The API call GetVersion will do it, but the information is
encrypted into a longint.  Here is how to get and decrypt the information:

  Type
    TGetVer = record
      WinVer,
      WinRev,
      DosRev,
      DosVer: Byte;
    end;
  const
    VerStr = '%d.%d';

  procedure TForm1.Button1Click(Sender: TObject);
  var
    AllVersions: TGetVer;
  begin
    AllVersions := TGetVer(GetVersion);
    Edit1.Text := Format(VerStr, [AllVersions.WinVer, AllVersions.WinRev]);
    Edit2.Text := Format(VerStr, [AllVersions.DOSVer, AllVersions.DOSRev]);
  end;

Note1:  The values that windows displays for the versions and the values
that it returns through its API call are not always the same.  e.g.  The
workgroup version displays as 3.10 rather than 3.11.

Note2: Win32 applications should call GetVersionEx rather than GetVersion.

--
��ϧһ�д�ۣ��ﵽ���������塣
��������߱����������߱��

m;31m�� ��Դ:���Ͻ�ɺ� bbs.njupt.edu.cn��[FROM: 202.119.236.104]m

--
�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu]
Technical Details
Message-ID: <3OAbRf$tH6@bbs.nju.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fc86e,51228637544305ac,start
X-Google-Attributes: gidfc86e,public
From: mendy.bbs@bbs.nju.edu.cn (�ϵ�)
Subject: How to get the windows and DOS versions
Date: 1998/04/19
Message-ID: <3OAbRf$tH6@bbs.nju.edu.cn>
X-Deja-AN: 345866731
X-Filename: Programming/M.893006393.A
Organization: nju_bbs
Newsgroups: cn.bbs.comp.program