Delphi Tips&Tricks News   Tips   .NET Software   VCL Software   Search   Contacts
Ultimate Pack - special offer!

Ultimate Pack  hot!
Image Editor  new!
Runtime Fusion
Form Designer
Object Inspector
Print Suite Pro
Commented Image
Delphi Toys
WinDowse
Delphi Bonus
TMS Scripter Studio
Form Designer VB
Form Designer .NET

...get more...
for Delphi.NET, C#, VB.NET
for Delphi VCL, BCB 3-6

WinAPI Online
Unix Manual Pages
MegaDetailed.NET
in3steps.com
cdtrrracks.com new!

Blogspot  greatis.blogspot.com

Detect windows version - System info - Tips & Tricks - Greatis Delphi Pages

Use GetVersionEx procedure with OSVERSIONINFO data structure.


procedure TForm1.Button2Click(Sender: TObject);
var
  Info: TOSVersionInfoA;
begin
  Info.dwOSVersionInfoSize:=sizeof(Info);
  GetVersionEx(Info);
  Label1.Caption:='MajorVersion - '+IntToStr(Info.dwMajorVersion);
  Label2.Caption:='MinorVersion - '+IntToStr(Info.dwMinorVersion);
  Label3.Caption:='BuildNumber - '+IntToStr(Info.dwBuildNumber);
  case Info.dwPlatformID of
    VER_PLATFORM_WIN32s:        Label4.Caption:='Win32 on Windows 3.1';
    VER_PLATFORM_WIN32_WINDOWS: Label4.Caption:='Win32 on Windows 95/98';
    VER_PLATFORM_WIN32_NT:      Label4.Caption:='Win32 on Windows NT';
  end;
end;
Related chapters
Registry
System

Related topics
Detect font (Small or Large) is in use
Use registry instead of *.ini file
Run program not in StartUp Folder

For more
Delphi Help
Win32 programmer's reference

Download source