Solved

Detecting Windows98

Posted on 1998-12-25
4
142 Views
Last Modified: 2010-04-04
I know how to detect Windows95 and WindowsNT but
how can I detect windows 98 is running.
The code I use is below.

Thanks Vincent
---------------------------------------
Var
OSVersionInfo : TOSVersionInfo;
Uitslag : String;

begin
  Uitslag := '';
  OSVersionInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
  GetVersionEx(OSVersionInfo);

  case OSVersionInfo.dwPlatformID of
    VER_PLATFORM_WIN32_WINDOWS : Uitslag := 'Windows95';
    VER_PLATFORM_WIN32_NT : Uitslag := 'WindowsNT';
  end;
0
Comment
Question by:Vincentg
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
heathprovost earned 10 total points
ID: 1352911
The easiest thing to do is to use the minor build number contained in the OSVersionInfo structure as follows:

...
  VER_PLATFORM_WIN32_NT: Uitslag := 'WindowsNT';
end;
if (OSVersionInfo.dwMinorVersion = 10) and
   (Utslag = 'Windows95') then Utslag := 'Windows98';

ps.  This could be written much cleaner but you should get the idea.  Basically if the dwMinorVersion is 10 then you are on Win98.

Hope this helps
0
 
LVL 5

Expert Comment

by:heathprovost
ID: 1352912
I typoed the answer above - it should be 1.0 or 1, not 10 for the minorVersion
0
 
LVL 2

Expert Comment

by:danysz
ID: 1352913
here is a complete answer

   osVerInfo.dwOSVersionInfoSize := SizeOf( OSVERSIONINFO);
   GetVersionEx( osVerInfo);

   case osVerInfo.dwPlatformId of
      VER_PLATFORM_WIN32s:
         begin
            OSPlatform.Caption := STR_OS + Chr( 9) + 'Win32s';
         end;
      VER_PLATFORM_WIN32_WINDOWS:
         begin
            osVerInfo.dwBuildNumber := osVerInfo.dwBuildNumber and $0000FFFF;
            if (osVerInfo.dwMajorVersion > 4) or ((osVerInfo.dwMajorVersion = 4) and
               (osVerInfo.dwMinorVersion >= 10)) then
            begin
               mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows 98';
            end
            else
            begin
               mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows 95';
            end;
         end;
      VER_PLATFORM_WIN32_NT:
      begin
         mnuOSPlatform.Caption := STR_OS + Chr( 9) + 'Windows NT';
      end;
   end; {case}

0
 

Expert Comment

by:Yoni
ID: 1352914
You can also use the get version function. You can find an example on how to use it in the win32.hlp file on the delphi cd.
There's also source there on how to get the build numbers but it's in c++
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now