Pues primero que todo les recomiendo a todos bajarse el Trucomania Explorer.. en
www.q3.nu. Este software, tiene una coleccion de trucos que puedes actualizar por red u off-line... de alli saque la solucion a este problema, asi:
Truco No 479
==================
procedure TForm1.Button1Click(Sender: TObject);
const
cOsUnknown : Integer = -1;
cOsWin95 : Integer = 0;
cOsWin98 : Integer = 1;
cOsWin98SE : Integer = 2;
cOsWinME : Integer = 3;
cOsWinNT : Integer = 4;
cOsWin2000 : Integer = 5;
cOsWhistler : Integer = 6;
function GetOSVersion : Integer;
var
osVerInfo : TOSVersionInfo;
majorVer, minorVer : Integer;
begin
Result := cOsUnknown;
osVerInfo.dwOSVersionInfoSize := SizeOf( TOSVersionInfo );
if ( GetVersionEx( osVerInfo ) ) then
begin
majorVer := osVerInfo.dwMajorVersion;
minorVer := osVerInfo.dwMinorVersion;
case ( osVerInfo.dwPlatformId ) of
VER_PLATFORM_WIN32_NT : { Windows NT/2000 }
begin
if ( majorVer <= 4 ) then Result := cOsWinNT
else
if ( ( majorVer = 5 ) and ( minorVer= 0 ) ) then Result := cOsWin2000
else
if ( ( majorVer = 5) and ( minorVer = 1 ) ) then Result := cOsWhistler
else
Result := cOsUnknown;
end;
VER_PLATFORM_WIN32_WINDOWS : { Windows 9x/ME }
begin
if ( ( majorVer = 4 ) and ( minorVer = 0 ) ) then Result := cOsWin95
else
if ( ( majorVer = 4 ) and ( minorVer = 10 ) ) then
begin
if ( osVerInfo.szCSDVersion[ 1 ] = 'A' ) then Result := cOsWin98SE
else Result := cOsWin98;
end
else
if ( ( majorVer = 4) and ( minorVer = 90 ) ) then Result := cOsWinME
else Result := cOsUnknown;
end;
else
Result := cOsUnknown;
end; { Final del Case}
end else Result := cOsUnknown; {Final del if}
end;
function GetOSName( OSCode : Integer ) : String;
begin
if ( OSCode = cOsUnknown ) then
Result := '(sconosciuto)'
else if ( OSCode = cOsWin95 ) then
Result := 'Microsoft Windows 95'
else if ( OSCode = cOsWin98 ) then
Result := 'Microsoft Windows 98'
else if ( OSCode = cOsWin98SE ) then
Result := 'Microsoft Windows 98 Second Edition'
else if ( OSCode = cOsWinME ) then
Result := 'Microsoft Windows Millennium Edition'
else if ( OSCode = cOsWinNT ) then
Result := 'Microsoft Windows New Technology'
else if ( OSCode = cOsWin2000 ) then
Result := 'Microsoft Windows 2000 / NT 5'
else
Result := 'Microsoft Windows';
end;
begin
Caption:=GetOsName ( GetOSVersion );
end;
==============================
Otra Version:
==============
procedure TForm1.Button1Click(Sender: TObject);
const
cOsUnknown : Integer = -1;
cOsWin95 : Integer = 0;
cOsWin98 : Integer = 1;
cOsWin98SE : Integer = 2;
cOsWinME : Integer = 3;
cOsWinNT : Integer = 4;
cOsWin2000 : Integer = 5;
cOsWinXP : Integer = 6;
function GetOSVersion : Integer;
var
osVerInfo : TOSVersionInfo;
majorVer, minorVer : Integer;
begin
osVerInfo.dwOSVersionInfoSize := SizeOf( TOSVersionInfo );
if ( GetVersionEx( osVerInfo ) ) then
begin
majorVer := osVerInfo.dwMajorVersion;
minorVer := osVerInfo.dwMinorVersion;
case ( osVerInfo.dwPlatformId ) of
VER_PLATFORM_WIN32_NT : { Windows NT/2000 }
begin
if ( majorVer <= 4 ) then Result := cOsWinNT
else
if ( ( majorVer = 5 ) and ( minorVer= 0 ) ) then Result := cOsWin2000
else
if ( ( majorVer = 5) and ( minorVer = 1 ) ) then Result := cOsWinXP
else
Result := cOsUnknown;
end;
VER_PLATFORM_WIN32_WINDOWS : { Windows 9x/ME }
begin
if ( ( majorVer = 4 ) and ( minorVer = 0 ) ) then Result := cOsWin95
else
if ( ( majorVer = 4 ) and ( minorVer = 10 ) ) then
begin
if ( osVerInfo.szCSDVersion[ 1 ] = 'A' ) then Result := cOsWin98SE
else Result := cOsWin98;
end
else
if ( ( majorVer = 4) and ( minorVer = 90 ) ) then Result := cOsWinME
else Result := cOsUnknown;
end;
else
Result := cOsUnknown;
end; { Final del Case}
end else Result := cOsUnknown; {Final del if}
end;
function GetOSName( OSCode : Integer ) : String;
begin
if ( OSCode = cOsUnknown ) then
Result := '(sconosciuto)'
else if ( OSCode = cOsWin95 ) then
Result := 'Microsoft Windows 95'
else if ( OSCode = cOsWin98 ) then
Result := 'Microsoft Windows 98'
else if ( OSCode = cOsWin98SE ) then
Result := 'Microsoft Windows 98 Second Edition'
else if ( OSCode = cOsWinME ) then
Result := 'Microsoft Windows Millennium Edition'
else if ( OSCode = cOsWinNT ) then
Result := 'Microsoft Windows New Technology'
else if ( OSCode = cOsWin2000 ) then
Result := 'Microsoft Windows 2000 / NT 5'
else if ( OSCode = cOsWinXP ) then
Result := 'Microsoft Windows XP'
else
Result := 'Microsoft Windows';
end;
begin
Caption:=GetOsName ( GetOSVersion );
end;
===================================