Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

O/S Detection

Posted on 2002-06-13
5
Medium Priority
?
326 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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 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