Link to home
Start Free TrialLog in
Avatar of fire_fly
fire_fly

asked on

O/S Detection

Is there a simple method of determining the O/S from within a Delphi app?  Code snippets appreciated, general advice also helps :)

Thanks,
Fire-fly
Avatar of robert_marquardt
robert_marquardt

http://delphi-jedi.org/CODELIBJCL
The JCL contains a function for that (among many other things).
Use The GetVersionEx API call...

Var
  OS : TOSVersionInfo;
Begin
  OS.dwVersionInfoSize := SizeOf(OS);
  GetVersionEx(OS);
  Case OS.dwPlatformID Of
    VER_PLATFORM_WIN32S : ; //Windows 3.1x
    VER_PLATFORM_WIN32_WINDOWS : ; //Windows 95/98/Me
    VER_PLATFORM_WIN32_NT : ; //NT Architecture
  End;
End;
Avatar of fire_fly

ASKER

robert: What function, how do I use it etc...

raidos: TOSVersionInfo?  GetVersionEx?  VER_PLATFORM_WIN32...?  Where are these defined...

If the answers to these questions are complimentary, thanks, how do I share the points amongst you?
ASKER CERTIFIED SOLUTION
Avatar of robert_marquardt
robert_marquardt

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
robert: What function, how do I use it etc...

raidos: TOSVersionInfo?  GetVersionEx?  VER_PLATFORM_WIN32...?  Where are these defined...

If the answers to these questions are complimentary, thanks, how do I share the points amongst you?