Solved

O/S Detection

Posted on 2002-06-13
5
318 Views
Last Modified: 2010-04-04
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
0
Comment
Question by:fire_fly
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7075135
http://delphi-jedi.org/CODELIBJCL
The JCL contains a function for that (among many other things).
0
 
LVL 3

Expert Comment

by:raidos
ID: 7075153
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;
0
 

Author Comment

by:fire_fly
ID: 7075175
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?
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 50 total points
ID: 7075225
JclSysInfo contains GetWindowsVersion which returns one of

TWindowsVersion = (wvUnknown, wvWin95, wvWin95OSR2, wvWin98, wvWin98SE, wvWinME, wvWinNT31, wvWinNT35, wvWinNT351, wvWinNT4, wvWin2000, wvWinXP);

The function is not fooled by Windows ME which sometimes disguises as Windows 98.
0
 

Author Comment

by:fire_fly
ID: 7075236
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?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Communication Between RC4 Delphi <-> PHP 3 123
QRReport  TQrmemo vertical stretching 1 53
Error E2158 compiling with Delphi XE10 Seattle 2 112
RESTRequest Parameter 4 42
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question