Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by �ϵ�
Sun, 19 Apr 1998 00:00
How to get the windows and DOS versions
Author: �ϵ�
Date: Sun, 19 Apr 1998 00:00
Date: Sun, 19 Apr 1998 00:00
49 lines
1935 bytes
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
--
[m[1;37m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu][m
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads