Solved

Detecting Windows98

Posted on 1998-12-25
4
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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