Se vc tiver a JEDI / JVCL, tem o TJvComputerInfoEx que retorna esta informação 
e muito mais...
[]s


Luiz Escobar - Analista/Desenvolvedor:
WEB - HTML/JavaScript/PHP/MySQL 
WINDOWS - Delphi/ASSEMBLY/MySQL/xBase
SERVIDORES - CNA IntraNetWare4.11, LINUX-(RedHat9/Suse11), Windows 2K/XP
HARBOUR 
--------------------------------------------------------------------------
Borland C++ 5.5.1 (32 bit)
Harbour 1.0.0 Intl. (Rev. 9175) 
xHarbour Compile build 1.1.0 (Simplex)
Harbour MiniGUI 1.5 Extended Edition (Build 55) - 2008.08.26
-------------------------------------------------------------------------------------------




From: Ricardo Mendes 
Sent: Tuesday, October 07, 2008 1:25 AM
To: delphi-br@yahoogrupos.com.br 
Subject: [delphi-br] OFF - DICA : Saber qual a versão do windows


function GetOS: String;
//----------------------------------------------------------
// *** Information about Win32CSDVersion ***
// In the Win 9x family, Win32CSDVersion detects Win 95 OSR2 and Win 98 SE
// In the Win NT family, Win32CSDVersion detects Service Pack information
// CSD is an acronym for Corrective Service Disk
//----------------------------------------------------------
var
PlatformId, VersionNumber: string;
CSDVersion: String;
begin
CSDVersion := '';

// Detect platform
case Win32Platform of
// Test for the Windows 95 product family
VER_PLATFORM_WIN32_WINDOWS:
begin
if Win32MajorVersion = 4 then
case Win32MinorVersion of
0: if (Length(Win32CSDVersion) > 0) and
(Win32CSDVersion[1] in ['B', 'C']) then
PlatformId := '95 OSR2'
else
PlatformId := '95';
10: if (Length(Win32CSDVersion) > 0) and
(Win32CSDVersion[1] = 'A') then
PlatformId := '98 SE'
else
PlatformId := '98';
90: PlatformId := 'ME';
end
else
PlatformId := '9x version (unknown)';
end;
// Test for the Windows NT product family
VER_PLATFORM_WIN32_NT:
begin
if Length(Win32CSDVersion) > 0 then CSDVersion := Win32CSDVersion;
if Win32MajorVersion <= 4 then
PlatformId := 'NT'
else
if Win32MajorVersion = 5 then
case Win32MinorVersion of
0: PlatformId := '2000';
1: PlatformId := 'XP';
2: PlatformId := 'Server 2003';
end
else if (Win32MajorVersion = 6) and (Win32MinorVersion = 0) then
PlatformId := 'Vista'
else
PlatformId := 'Future Windows version (unknown)';
end;
end;
VersionNumber := Format(' Version %d.%d Build %d %s', [Win32MajorVersion,
Win32MinorVersion,
Win32BuildNumber,
CSDVersion]);
Result := 'Microsoft Windows ' + PlatformId + VersionNumber;

{Para imprimir apenas a versão do windows e pack eu alterei a ultima linha do 
result...ficando assim
Exemplo: Windows XP - Service Pack 2

Result := 'Microsoft Windows '+ PlatformId ' - ' + CSDVersion;

}
end;

----------------------------------------------------------
para utilizar:

labelVersão.Caption:= GetOS;
----------------------------------------------------------
Fonte Original: http://www.tek-tips.com/faqs.cfm?fid=3232

[As partes desta mensagem que não continham texto foram removidas]



 

[As partes desta mensagem que não continham texto foram removidas]

Responder a